[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"6lXahkNouZ":3},"# ktv-swap-lean-comparator\n\n[![comparator](https://github.com/guanyangwang/ktv-swap-lean-comparator/actions/workflows/comparator.yml/badge.svg)](https://github.com/guanyangwang/ktv-swap-lean-comparator/actions/workflows/comparator.yml)\n\nIndependent comparator verification, via `leanprover/comparator`, that\n`guanyangwang/ktv-swap-lean` proves the fixed-margin lazy swap-chain spectral\ngap bound from Theorem 2.2 of *Spectral Gap for the Binary Fixed-Margin Swap\nChain*.\n\n## What to audit\n\nAudit `ChallengeDefs.lean` and `Challenge.lean`. `ChallengeDefs.lean` imports\nonly Mathlib and defines:\n\n- binary matrices with prescribed row and column sums;\n- the ordered-distinct rectangle proposal;\n- the `1/2`-lazy swap operator;\n- the finite rational Poincare/Dirichlet-form spectral-gap predicate.\n\n`Challenge.lean` then states that the lazy swap operator has gap at least\n\n```text\n1 / choose(|Col|, 2) * 1 / choose(|Row|, 2).\n```\n\nIf you believe `ChallengeDefs.lean` and `Challenge.lean` say the\nintended theorem, then a successful comparator run certifies that the\n`ktv-swap-lean` library proves it using only the axioms `propext`, `Quot.sound`, and `Classical.choice`.\n\n`Solution.lean` imports `ChallengeDefs.lean` and the KTV proof library,\nthen bridges the Mathlib-only statement to the library theorem by an explicit\nequivalence of state spaces. Comparator rebuilds both modules in a sandbox, exports them with `lean4export`, compares the statements, checks the\naxioms, and replays the proof through the Lean kernel.\n\n## Status\n\nThe GitHub Actions workflow runs `./verify.sh` on Ubuntu for every push and\npull request. The current status is shown by the badge above.\n\n## Run it\n\n```bash\n./verify.sh\n```\n\nThis is intended for Linux. It downloads pinned `comparator`, `lean4export`,\nand `landrun`, fetches the Mathlib cache, and runs the check. Expected final\noutput:\n\n```text\nYour solution is okay!\n```\n\nOn macOS, real `landrun` is not available; use Linux or the included GitHub\nActions workflow for the trusted sandboxed comparator run.\n",1789154852917]