[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"mn5hWv6OVp":3},"# hex-lll\n\nPart of [`hex`](https://github.com/kim-em/hex-dev), a computer algebra\nlibrary for Lean 4.\n\n`hex-lll` computes Lenstra-Lenstra-Lovász reduced bases for integer row\nlattices without depending on Mathlib. It provides an exact integer reducer\nand a checker that can certify the output of an optional external reducer.\nBoth methods return a reduced basis for the same lattice.\n\n# Quickstart\n\nAdd the package to `lakefile.toml`:\n\n```toml\n[[require]]\nname = \"hex-lll\"\ngit = \"https://github.com/leanprover/hex-lll.git\"\nrev = \"main\"\n```\n\nThen check the executable operations:\n\n```lean\nimport HexLLL\n\nopen Hex\n\n#check @lll\n#check @lll.firstShortVector\n#check @lll.shortVectors\n#check @lllNative\n#check @lllReduced\n#check @certCheck\n```\n\nThese commands work in the Lean interpreter. Running the native reducer on a\nconcrete basis requires a compiled executable because its exact division\noperation is supplied by native code.\n\n# Functionality\n\n`lll b δ` returns a `(δ, 11/20)`-reduced basis spanning the same row lattice\nas `b`. Its proof arguments express `121/400 \u003C δ`, `δ ≤ 1`, and a nonempty\nbasis. The `lll.firstShortVector` and `lll.shortVectors` operations select the\nfirst row or all rows of the reduced basis.\n\n`lllNative` is the exact integer reducer. It satisfies the tighter classical\nsize-reduction bound `1/2`. The ordinary `lll` operation may instead use an\nexternal candidate after `certCheck` proves reducedness and equality of the\ngenerated lattice. If no candidate is installed or the check fails, it uses\n`lllNative`.\n\nThe public predicates include `Matrix.memLattice`, `Matrix.independent`,\n`Vector.normSq`, `isLLLReduced`, and the executable reducedness checks\n`lllReduced`, `lllReducedInterval`, and `lllReducedCheck`.\n\nDetailed timings against fpLLL and the verified Isabelle extraction are in\n[PERFORMANCE.md](PERFORMANCE.md).\n\n# Verification\n\nThe Mathlib-free package proves the rational short-vector estimate from\nreducedness and proves the lattice-preservation part of the external\ncertificate. [`hex-lll-mathlib`](https://github.com/leanprover/hex-lll-mathlib)\nproves that both reducers satisfy their reducedness and lattice-preservation\ncontracts and states the short-vector theorem using Mathlib's Euclidean norm.\n\nThe external reducer is not trusted. Its candidate must pass the integer\nchecker before it can affect the result. See the\n[SPEC](SPEC/hex-lll.md) for the exact contracts, implementation invariants,\nand benchmark protocol.\n\n# Contributing\n\nDevelopment happens in the\n[`hex-dev`](https://github.com/kim-em/hex-dev) monorepo, not in this published\nmirror. Contributions are welcome as pull requests to the `SPEC/` directory:\ndescribe the behavior you want and leave the implementation to the maintainer.\n",1790445566245]