{"id":52016187,"url":"https://github.com/leanprover/hex-mv-poly-mathlib","last_synced_at":"2026-07-31T22:00:27.930Z","repository":{"id":373881224,"uuid":"1317246328","full_name":"leanprover/hex-mv-poly-mathlib","owner":"leanprover","description":"Mathlib bridge for HexMvPoly","archived":false,"fork":false,"pushed_at":"2026-07-30T14:35:11.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-30T16:10:30.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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,"disclosure":null}},"created_at":"2026-07-30T12:29:55.000Z","updated_at":"2026-07-30T14:39:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leanprover/hex-mv-poly-mathlib","commit_stats":null,"previous_names":["leanprover/hex-mv-poly-mathlib"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/leanprover/hex-mv-poly-mathlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-mv-poly-mathlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-mv-poly-mathlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-mv-poly-mathlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-mv-poly-mathlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/hex-mv-poly-mathlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-mv-poly-mathlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36134849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-31T02:00:06.731Z","response_time":112,"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-31T22:00:21.796Z","updated_at":"2026-07-31T22:00:27.916Z","avatar_url":"https://github.com/leanprover.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hex-mv-poly-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-mv-poly-mathlib` is the Mathlib bridge for\n[`hex-mv-poly`](https://github.com/leanprover/hex-mv-poly). It identifies\nthe executable sparse representation with `MvPolynomial (Fin n) R` and\ntransports the proof-facing algebraic API. It depends on Mathlib,\n[`hex-mv-poly`](https://github.com/leanprover/hex-mv-poly), and\n[`hex-poly-mathlib`](https://github.com/leanprover/hex-poly-mathlib).\n\n# Quickstart\n\nAdd to your `lakefile.toml`:\n\n```toml\n[[require]]\nname = \"hex-mv-poly-mathlib\"\ngit = \"https://github.com/leanprover/hex-mv-poly-mathlib.git\"\nrev = \"main\"\n```\n\n```lean\nimport HexMvPolyMathlib\n\nopen Hex Hex.MvPoly HexMvPolyMathlib\nopen scoped HexMvPolyMathlib\n\nabbrev P := MvPoly 2 Int Mono.lex\n\n#check (equiv : P ≃+* MvPolynomial (Fin 2) Int)\n\nexample (p q : P) :\n    toMvPolynomial (p * q) =\n      toMvPolynomial p * toMvPolynomial q := by\n  simp\n```\n\n# Functionality\n\n- The exponent-vector equivalence `monoEquiv` and exact polynomial\n  conversions `toMvPolynomial` and `ofMvPolynomial`.\n- The ring and algebra equivalences `equiv` and `algEquiv`, with transported\n  `CommSemiring`, `CommRing`, and `Algebra` structures whose operations remain\n  the executable ones.\n- The algebra homomorphism `aeval` and its laws for constants, variables,\n  addition, multiplication, powers, negation, and subtraction.\n- Correspondence theorems for support, total and per-variable degree,\n  differentiation, homogeneous components, substitution, partial evaluation,\n  renaming, and storage reordering.\n- Ring equivalences for the recursive view, the zero-variable case, and the\n  one-variable dense-polynomial case.\n\n# Verification\n\nThe correspondence is fully proven in both directions:\n\n```lean\ndef equiv [CommSemiring R] [DecidableEq R] :\n    MvPoly n R cmp ≃+* MvPolynomial (Fin n) R\n```\n\nIt preserves every coefficient:\n\n```lean\ntheorem coeff_toMvPolynomial [CommSemiring R] [DecidableEq R]\n    (m : Mono n) (p : MvPoly n R cmp) :\n    MvPolynomial.coeff (monoEquiv m) (toMvPolynomial p) =\n      coeff m p\n```\n\nExecutable evaluation is Mathlib algebra evaluation after conversion:\n\n```lean\ntheorem aeval_apply [CommSemiring R] [DecidableEq R]\n    [CommSemiring S] [Algebra R S]\n    (x : Fin n → S) (p : MvPoly n R cmp) :\n    aeval x p = MvPolynomial.aeval x (toMvPolynomial p)\n```\n\nThe Mathlib-free representation and executable algorithms live in\n[`hex-mv-poly`](https://github.com/leanprover/hex-mv-poly).\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-mv-poly-mathlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2Fhex-mv-poly-mathlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Fhex-mv-poly-mathlib/lists"}