{"id":52016185,"url":"https://github.com/leanprover/hex-berlekamp-zassenhaus","last_synced_at":"2026-07-31T22:00:27.924Z","repository":{"id":374049345,"uuid":"1318255936","full_name":"leanprover/hex-berlekamp-zassenhaus","owner":"leanprover","description":"Verified Berlekamp-Zassenhaus factorization over the integers","archived":false,"fork":false,"pushed_at":"2026-07-31T15:41:28.000Z","size":285,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-31T17:12:22.081Z","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-31T11:03:16.000Z","updated_at":"2026-07-31T15:42:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leanprover/hex-berlekamp-zassenhaus","commit_stats":null,"previous_names":["leanprover/hex-berlekamp-zassenhaus"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/leanprover/hex-berlekamp-zassenhaus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-berlekamp-zassenhaus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-berlekamp-zassenhaus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-berlekamp-zassenhaus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-berlekamp-zassenhaus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/hex-berlekamp-zassenhaus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Fhex-berlekamp-zassenhaus/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:18.809Z","updated_at":"2026-07-31T22:00:27.898Z","avatar_url":"https://github.com/leanprover.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hex-berlekamp-zassenhaus\n\nPart of [`hex`](https://github.com/kim-em/hex-dev), a computer algebra\nlibrary for Lean 4.\n\nThis package factors dense univariate polynomials over `ℤ` without depending\non Mathlib. It combines modular Berlekamp factorization, multifactor Hensel\nlifting, classical or lattice recombination, and exact trial division. The\nresult records the signed scalar separately from primitive factors and their\nmultiplicities.\n\n# Quickstart\n\n```toml\n[[require]]\nname = \"hex-berlekamp-zassenhaus\"\ngit = \"https://github.com/leanprover/hex-berlekamp-zassenhaus.git\"\nrev = \"main\"\n```\n\n```lean\nimport HexBerlekampZassenhaus\n\nopen Hex\n\n#check ZPoly.factorize\n#check ZPoly.factors\n#check Factorization.product\n#check factorClassical\n#check factorLattice\n#check factorTrial\n```\n\n# Functionality\n\n`ZPoly.factorize` is the total user operation. It normalizes content, sign,\npowers of `X`, and repeated factors before factoring the primitive square-free\npart. Small modular factorizations use classical subset recombination. Larger\nones use a lattice generated from coefficient vectors and logarithmic\nderivatives. Exact trial division proves totality when modular methods do not\nreturn an answer.\n\nThe ordinary umbrella also supplies `factor_poly` and `irreducibility` for\n`Hex.ZPoly`. Search runs in compiled elaborator code and emits product and\nirreducibility certificates checked by the kernel:\n\n```lean\nimport HexBerlekampZassenhaus\n\nopen Hex\n\ndef f : ZPoly := DensePoly.ofCoeffs #[1, 0, 1]\n\nnoncomputable def fFactored := factor_poly f\ntheorem fIrreducible : ZPoly.Irreducible f := irreducibility f\n```\n\nImport `HexBerlekampZassenhaus.All` only when developing the algorithms and\ntheir internal certificates.\n\n# Verification\n\nThe computational package defines a Mathlib-free irreducibility predicate and\nthe executable checks needed by the proof library.\n[`hex-berlekamp-zassenhaus-mathlib`](https://github.com/leanprover/hex-berlekamp-zassenhaus-mathlib)\nproves product reconstruction, factor irreducibility, normalization, and\nuniqueness.\n\nThe lattice method uses coefficient vectors of logarithmic derivatives in the\nsense of van Hoeij. The exact trial method is independent of finding a\nsuitable prime, so the public factorization operation is total. See the\n[SPEC](SPEC/hex-berlekamp-zassenhaus.md) for the algorithms, contracts, and\ntest 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Fhex-berlekamp-zassenhaus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2Fhex-berlekamp-zassenhaus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Fhex-berlekamp-zassenhaus/lists"}