{"id":51428380,"url":"https://github.com/leanprover/hex-determinant-mathlib","last_synced_at":"2026-07-05T03:00:28.528Z","repository":{"id":368213338,"uuid":"1283547252","full_name":"leanprover/hex-determinant-mathlib","owner":"leanprover","description":"Mathlib correspondence proofs for hex-determinant. Published from hex-dev.","archived":false,"fork":false,"pushed_at":"2026-07-04T04:42:12.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-04T06:25:06.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kim-em.github.io/hex-dev/find/?domain=Verso.Genre.Manual.section\u0026name=hex-determinant","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leanprover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-29T02:57:49.000Z","updated_at":"2026-07-04T04:42:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leanprover/hex-determinant-mathlib","commit_stats":null,"previous_names":["kim-em/hex-determinant-mathlib","leanprover/hex-determinant-mathlib"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/leanprover/hex-determinant-mathlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-determinant-mathlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-determinant-mathlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-determinant-mathlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-determinant-mathlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/hex-determinant-mathlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-determinant-mathlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35141966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-05T03:00:21.391Z","updated_at":"2026-07-05T03:00:28.493Z","avatar_url":"https://github.com/leanprover.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hex-determinant-mathlib\n\nPart of [`hex`](https://github.com/kim-em/hex-dev), a computer algebra\nlibrary for Lean 4. The aim is fast executable code, fully verified, built\nwith spec-driven development.\n\n`hex-determinant-mathlib` is the Mathlib bridge for\n[`hex-determinant`](https://github.com/leanprover/hex-determinant). It identifies\nthe executable Leibniz determinant with Mathlib's `Matrix.det`, so Mathlib's\ndeterminant theory transfers to the executable matrices. This library depends\non [`hex-determinant`](https://github.com/leanprover/hex-determinant) and on\nMathlib.\n\n# Quickstart\n\nAdd to your `lakefile.toml`:\n\n```toml\n[[require]]\nname = \"hex-determinant-mathlib\"\ngit = \"https://github.com/leanprover/hex-determinant-mathlib.git\"\nrev = \"main\"\n```\n\n```lean\nimport HexDeterminantMathlib\n\nopen Hex HexMatrixMathlib\n\n-- The executable Leibniz determinant equals Mathlib's `Matrix.det`.\n#check @det_eq\n\n-- A leading principal submatrix determinant, restated in Mathlib terms.\n#check @det_principalSubmatrix_eq_submatrix_det\n\n-- The Desnanot-Jacobi identity for a Bareiss bordered minor.\n#check @desnanot_jacobi_borderedMinor\n```\n\n# Functionality\n\nThe proof-facing API connects the executable determinant to Mathlib:\n\n- `det_eq`: the executable `Hex.Matrix.det` equals `Matrix.det` of the\n  corresponding Mathlib matrix `matrixEquiv M`;\n- the permutation-sign bridge: `PermutationVector.toPerm`,\n  `PermutationVector.equivs`, and `detSign_eq_permSign`, matching Hex's\n  inversion-count sign to `Equiv.Perm.sign`;\n- submatrix transport: `matrixEquiv_borderedMinor` and the determinant forms\n  `det_principalSubmatrix_eq_submatrix_det` and\n  `det_borderedMinor_eq_submatrix_det`;\n- the Plücker three-term identity `det_plucker_three_term` and the\n  Desnanot-Jacobi identities `desnanot_jacobi` and\n  `desnanot_jacobi_borderedMinor` used by the Bareiss correctness proof.\n\n# Verification\n\nThe determinant correspondence is fully proven over a `CommRing`. The\nheadline theorem identifies the two determinants:\n\n```lean\ntheorem det_eq [CommRing R] (M : Hex.Matrix R n n) :\n    Hex.Matrix.det M = Matrix.det (matrixEquiv M)\n```\n\nThe Plücker three-term identity, assembled for the Bareiss correctness proof:\n\n```lean\ntheorem det_plucker_three_term\n    {R : Type u} [CommRing R] {n : Nat}\n    (B : Hex.Matrix R (n + 3) (n + 1)) (v : Vector R (n + 3))\n    (p1 p2 p3 : Fin (n + 3))\n    (h12 : p1.val \u003c p2.val) (h23 : p2.val \u003c p3.val) :\n    Hex.Matrix.mDet B v p1 * Hex.Matrix.nDet B p2 p3 h23 -\n      Hex.Matrix.mDet B v p2 * Hex.Matrix.nDet B p1 p3 (Nat.lt_trans h12 h23) +\n      Hex.Matrix.mDet B v p3 * Hex.Matrix.nDet B p1 p2 h12 = 0\n```\n\nThe Desnanot-Jacobi identity over Mathlib matrices:\n\n```lean\ntheorem desnanot_jacobi {R : Type*} [CommRing R] {n : ℕ}\n    (M : Matrix (Fin (n + 2)) (Fin (n + 2)) R) :\n    M.det * (M.submatrix (Fin.succAbove 0 ∘ (Fin.last n).succAbove)\n      (Fin.succAbove 0 ∘ (Fin.last n).succAbove)).det =\n    (M.submatrix (Fin.succAbove 0) (Fin.succAbove 0)).det *\n      (M.submatrix (Fin.last (n + 1)).succAbove (Fin.last (n + 1)).succAbove).det -\n    (M.submatrix (Fin.succAbove 0) (Fin.last (n + 1)).succAbove).det *\n      (M.submatrix (Fin.last (n + 1)).succAbove (Fin.succAbove 0)).det\n```\n\nThe Leibniz determinant and its cofactor, adjugate, and Cauchy-Binet theory\nlive in [`hex-determinant`](https://github.com/leanprover/hex-determinant); the\n`bareiss = det` headline theorems live in\n[`hex-bareiss-mathlib`](https://github.com/leanprover/hex-bareiss-mathlib).\n\n# Reference manual\n\nThe hex reference manual covers this library and its computational base at\n\u003chttps://kim-em.github.io/hex-dev/find/?domain=Verso.Genre.Manual.section\u0026name=hex-determinant\u003e.\n\n# Contributing\n\nDevelopment happens in the [`hex-dev`](https://github.com/kim-em/hex-dev)\nmonorepo, not in this published mirror. Contributions are welcome as pull\nrequests to the `SPEC/` directory: describe the behaviour you want, and\nleave the implementation to the maintainer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Fhex-determinant-mathlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2Fhex-determinant-mathlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Fhex-determinant-mathlib/lists"}