{"id":50568422,"url":"https://github.com/leanprover/lp-backend-pure","last_synced_at":"2026-06-04T17:00:24.942Z","repository":{"id":359384004,"uuid":"1245513456","full_name":"leanprover/lp-backend-pure","owner":"leanprover","description":"LPBackend adapter: pure-Lean LP solver, zero native deps. Priority 100 for the by lp tactic registry.","archived":false,"fork":false,"pushed_at":"2026-06-04T04:52:47.000Z","size":79,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T06:22:25.647Z","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":null,"dco":null,"cla":null}},"created_at":"2026-05-21T09:40:01.000Z","updated_at":"2026-06-04T04:52:51.000Z","dependencies_parsed_at":"2026-05-22T01:01:56.947Z","dependency_job_id":null,"html_url":"https://github.com/leanprover/lp-backend-pure","commit_stats":null,"previous_names":["kim-em/lp-backend-pure","leanprover/lp-backend-pure"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leanprover/lp-backend-pure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flp-backend-pure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flp-backend-pure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flp-backend-pure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flp-backend-pure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanprover","download_url":"https://codeload.github.com/leanprover/lp-backend-pure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanprover%2Flp-backend-pure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33914548,"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-06-04T02:00:06.755Z","response_time":64,"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-06-04T17:00:17.576Z","updated_at":"2026-06-04T17:00:24.866Z","avatar_url":"https://github.com/leanprover.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LPBackendPure\n\n[![Lean](https://img.shields.io/badge/Lean-4.29.1-blue.svg)](./lean-toolchain)\n[![License](https://img.shields.io/github/license/leanprover/lp-backend-pure.svg)](./LICENSE)\n\n\u003e **New here? Start at [`leanprover/lp`](https://github.com/leanprover/lp)** — the entry\n\u003e point for the `lp` / `maximize` tactics and the verified LP solver. This repository is one\n\u003e package of that family: the pure-Lean backend adapter (scaffold).\n\nPure-Lean `LPBackend` adapter for the `by lp` tactic registry.\nZero native deps, zero subprocess calls. Self-registers with the\n[`leanprover/lp-tactic`](https://github.com/leanprover/lp-tactic) registry\nunder priority 100 (\"pure tier\") on import.\n\nThe point is to let a downstream user get `by lp` working with a\nsingle `import` and zero install steps — no SoPlex, no Boost, no\nGMP. This is the backend for CI lanes and demos, not for\nproduction solves: the verifier consumes exact rationals (`Rat`),\nso the simplex runs on arbitrary-precision arithmetic the whole\nway through. Expect performance to be poor on anything beyond\ntoy LPs. Use\n[`leanprover/lp-backend-soplex-ffi`](https://github.com/leanprover/lp-backend-soplex-ffi)\nfor production.\n\n## Quickstart\n\n```lean\nrequire LPBackendPure from git\n  \"https://github.com/leanprover/lp-backend-pure\" @ \"main\"\n```\n\n```lean\nimport LPTactic\nimport LPBackendPure  -- registers \"pure\" at priority 100\n\n-- No system deps required; this works in a fresh container with\n-- only Lean installed.\nexample (a b : Rat) (_ : 2 * a + b ≤ 5) (_ : a - b ≤ 1) :\n    3 * a ≤ 6 := by lp\n```\n\n## Status\n\nThe backend runs a two-phase tableau-based primal simplex on `Rat`\n(Dantzig's rule with a Bland fallback on suspected cycling), and\nthe produced certificates re-verify under\n[`leanprover/lp-verify`](https://github.com/leanprover/lp-verify).\nThe supported scope now matches the FFI backend on the `by lp`\nexamples in `LPTest/LP.lean` (see\n`LPBackendPureTest/LPParity.lean`):\n\n- Row shapes — `(none, some hi)`, `(some lo, none)`, `(some lo, some hi)`\n  (equality or proper range), `(none, none)` — preprocessed into upper-only\n  rows.\n- Column shapes — free, lower-bounded, upper-only, boxed, negative-lower —\n  preprocessed into nonnegative standard-form variables.\n- `SolveStatus.optimal`, `SolveStatus.unbounded` (with recession ray),\n  and `SolveStatus.infeasible` (with Farkas dual read off phase 1's\n  final tableau).\n\nMaximisation is handled by canonicalising to minimisation. The\ncertificate is against the canonical (min) problem, matching\n`LP.Verify.IsOptimal`. `Solution.objective` is restored to\nthe caller's original sense.\n\nPerformance is expected to be poor — this is a dense `Rat` tableau,\nno presolve, no sparse data structures. Use the FFI backend in\nproduction; this backend is for CI lanes, demos, and downstream\nprojects that want `by lp` working with a single `import`.\n\n## Layout\n\n```\nLPBackendPure.lean         # top-level import\nLPBackendPure/\n  Backend.lean             # LPBackend value, probe, solveExact wrapper\n  Simplex.lean             # primal simplex on Rat with Bland's rule\nLPBackendPureTest/\n  Simplex.lean             # behavioral tests; re-verifies certificates\n  LPParity.lean            # `by lp` parity sweep against LPTest/LP.lean\n  Runner.lean              # `lake test` entry point\n```\n\nThe backend lives under `namespace LP.Backend.Pure`, mirroring\nthe other backend repos.\n\n## Licence\n\n[Apache License 2.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Flp-backend-pure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanprover%2Flp-backend-pure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanprover%2Flp-backend-pure/lists"}