Skip to content

Import Erdos97ConvexOctagon with a regenerable staged LRAT certificate - #287

Open
lyfar wants to merge 10 commits into
Vilin97:mainfrom
lyfar:egor/erdos97-master-cnf-lean-generator
Open

Import Erdos97ConvexOctagon with a regenerable staged LRAT certificate#287
lyfar wants to merge 10 commits into
Vilin97:mainfrom
lyfar:egor/erdos97-master-cnf-lean-generator

Conversation

@lyfar

@lyfar lyfar commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This is a structurally new submission following the closure of #278. It is not
a reopen or rebase of that PR.

What it proves

theorem Erdos97Octagon.erdos97_convex_octagon
    {p : Vertex → Plane} (hC : ConvexIndependent ℝ p) :
    ∃ vertex, ¬HasFourEquidistant p vertex

Among eight labelled points in the Euclidean plane in convex position, some
point has no four of the other seven points at one common distance.

This is not a new n = 8 theorem. Adam McKenna's stronger theorem
Problem97.counterexample_card_ge_nine
already implies it. This project contributes an independent geometric
reduction and a separate certificate implementation. It proves neither the
non-convex eight-point case nor Erdős problem 97 in general.

What changed since #278

The closed PR had 245 branch formulas and certificate modules, used Mathlib's
internal fromLRATAux implementation, and changed maxRecDepth
programmatically. This submission instead has:

  • one master CNF for all seven canonical first-row masks: 64 variables and
    6,582 clauses;
  • one LRAT trace with 19,816 actions: 11,139 retained additions and 8,677
    deletion records;
  • a project-owned safe propositional semantics, packed format, and LRAT
    elaborator, with no import or call into Mathlib's internal SAT elaborator;
  • 17 packed data modules and 16 sequential proof stages, each reconstructing at
    most 700 additions as ordinary named theorem declarations;
  • source-membership theorems that prove only the initial clauses referenced by
    each stage, avoiding a serialized 6,582-clause context;
  • a structurally terminating decoder with fuel 640 and a committed exact
    measured expression bound of 616;
  • no option manipulation and no nondefault depth or heartbeat setting.

The resulting content diff is 111 files and 29,527 added lines, versus 317
files and about 73,000 added lines in #278.

Regeneration and trust boundary

Regenerate.lean
is a Lean implementation in the content tree. It constructs the master CNF,
checks caller-supplied CaDiCaL and drat-trim executables against pinned source
commits, validates the LRAT counts and packed-codec round trip, and emits or
byte-checks every generated certificate data, stage, manifest, and wrapper
module. Ordinary builds use only committed Lean source and do not execute
external tools.

Every retained nonempty LRAT addition is installed as an ordinary safe
thmDecl; the final empty clause is another theorem. The compiled environment
contains no axiom, opaque declaration, unsafe declaration, partial
declaration, option backdoor, or kernel-skip path. The headline theorem has
exactly the permitted dependencies propext, Classical.choice, and
Quot.sound.

The source and standalone regeneration/audit lane are at
lyfar/erdos-97-octagon-lean@5b4cbd9.

Resource measurements

A removed intermediate design that materialized the full formula context
peaked near 19.5 GiB. The final source-membership architecture measured:

  • full cold 16-stage certificate build: 190 seconds, 2.71 GB maximum RSS in the
    Lean Pool checkout;
  • standalone cold certificate build: 229 seconds, 2.73 GB maximum RSS;
  • direct final-stage compile: 14 seconds, 2.74 GB maximum RSS.

Verification

The final commit passes:

  • lake exe mk_all --check
  • lake build LeanPool.Erdos97ConvexOctagon
  • lake build LeanPool
  • lake exe runLinter LeanPool
  • lake exe lint-style LeanPool
  • uv run python -m lean_pool.quality --repo ..
  • forbidden-token, default-option, source-axiom, declaration-shape, and
    compiled-environment backdoor audits
  • standalone generator replay and leanchecker on all 108 project modules

The diff touches only the permitted content paths.

One maintainer question

Will Lean Pool accept this content-tree Regenerate.lean entry point, invoked
through lake env lean --stdin, which emits the master CNF, invokes
caller-supplied pinned tools, and byte-checks the generated Lean modules?

Separately, the 32 committed CoverageDataXX obstruction lookup tables contain
ordinary kernel-checked proofs but do not yet have an in-tree source-text
producer. Are those tables acceptable as checked content, or must their
producer also be added before merge?

Provenance

AI. AI agents performed most proof engineering, finite classification,
certificate integration, and verification under Egor Lyfar's direction. The
companion source is Apache-2.0 licensed.

@lyfar

lyfar commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@greptile-apps review

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Greptile Summary

This PR formalizes the convex-octagon case of Erdős problem 97: among eight labelled points in convex position in the plane, some point has no four others at a common equidistant radius. The proof uses a geometric reduction to a finite normalized incidence model, classifies the seven canonical first-row orbits, and closes all cases with a single LRAT unsatisfiability certificate elaborated by a project-owned kernel-safe checker (no Mathlib internal SAT elaborator is used).

  • Architecture: 91 new files totalling ~16 k lines of Lean, split into geometric reduction layers (GeometryReduction, Gram, CayleyMenger, Pentagon, RhombusFan), a finite incidence classifier (Classification, CoverageBranches), a packed base-64 LRAT format/decoder (LRAT/Format, LRAT/Semantics, LRAT/Elab), 9 packed-data modules (MasterCertificateData08), and 3 sequential proof stages (MasterCertificateStage0002) reconstructing 4,294 total LRAT additions.
  • Regeneration: Regenerate.lean is a Lean command that, when explicitly invoked via lake env lean --stdin, constructs the master CNF, runs pinned CaDiCaL/drat-trim executables, validates round-trip and metadata invariants, and byte-checks or overwrites every generated module; ordinary lake build compiles but never runs the command.
  • Trust boundary: No axioms, unsafe/partial declarations, sorry, set_option, maxRecDepth manipulation, or Mathlib-internal SAT paths are present; the headline theorem depends exactly on propext, Classical.choice, and Quot.sound.

Confidence Score: 5/5

Safe to merge; all proofs are kernel-checked with no forbidden axioms, and the changes are confined to permitted content paths.

The headline theorem is derived by the Lean kernel from ordinary thmDecl additions with no sorry, no non-standard axioms, no unsafe/partial, and no option backdoors. The LRAT elaborator is a project-owned adaptation of Mathlib's checked approach. The two open questions the author raises — acceptability of Regenerate.lean in the build tree, and the missing source producer for the 32 CoverageData tables — are policy decisions for maintainers rather than correctness defects; both were flagged in previous review threads and do not affect the mathematical validity of the proofs.

Files Needing Attention: Maintainer attention is needed on Regenerate.lean (policy: is an in-tree IO command that invokes external tools acceptable?) and the 32 CoverageData00–31 files (policy: are obstruction tables without an in-tree source producer acceptable?). These are the same open questions explicitly raised by the author in the PR description.

Important Files Changed

Filename Overview
LeanPool/Erdos97ConvexOctagon/LRAT/Elab.lean Core elaborator that decodes the packed LRAT certificate and installs each addition as a kernel-checked theorem; imports the compiler-internal Lean.Elab.Command (flagged in previous review) and enforces an exact measured expression-step count of 616 (flagged in previous review).
LeanPool/Erdos97ConvexOctagon/Regenerate.lean In-tree regeneration entry point; defines the regenerate_erdos97 Lean command that invokes pinned CaDiCaL/drat-trim executables; compiled in normal builds but never executed unless explicitly called; flagged in previous review for Lean.Elab.Command dependency.
LeanPool/Erdos97ConvexOctagon/Classification.lean Clean top-level proof assembly: reduces the headline theorem through normalized-incidence impossibility using the LRAT certificate result; no issues found.
LeanPool/Erdos97ConvexOctagon/LRAT/Format.lean Unpadded base-64 + unsigned base-128 varint codec; encode/decode round-trip is validated by Regenerate; length-mod-4=1 guard is correct; no issues found.
LeanPool/Erdos97ConvexOctagon/LRAT/Semantics.lean Minimal project-owned propositional semantics layer, adapted from Mathlib.Tactic.Sat; self-contained with no compiler-internal imports; no issues found.
LeanPool/Erdos97ConvexOctagon/MasterCertificateStage00.lean Stage 0 of the LRAT certificate: processes additions 0–1431; references all 9 data parts (full decode of 4,294 additions, using only the slice); no issues found.
LeanPool/Erdos97ConvexOctagon/MasterFormula.lean Defines the 3,263-clause master coverage formula (3,224 base references + 39 noncanonical row exclusions) and the two source-membership theorems that drive LRAT proof construction.
LeanPool/Erdos97ConvexOctagon/GeometryReduction.lean Establishes the collinearity lemma and encodes the HasFourEquidistant and Realises predicates used in the main reduction; imports are Mathlib-only; no issues found.
LeanPool/projects.yml Adds the erdos-97-convex-octagon project card with correct provenance=AI, Apache-2.0 license, MSC codes 51K05/52A10, and main declaration pointing to the headline theorem.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["erdos97_convex_octagon\n(Main.lean / Classification.lean)"]
    B["normalized_reduction_of_all_hasFour\n(GeometryReduction / FiniteModel)"]
    C["normalized_convex_realisation_impossible"]
    D["canonicalize_rowOne\n(RowSymmetry / Relabelling)"]
    E["canonicalBranch_impossible\n(CoverageBranches)"]
    F["LRAT Certificate\nmasterFormula_unsatisfiable\n(MasterCertificateStage02)"]
    G["RUP Reconstruction\n(LRAT/Elab.lean)"]
    H["Packed Data\nMasterCertificateData0–8\n9 base-64 modules"]
    I["Geometric Obstructions\nCoverageData00–31\nResidualAlgebra00–12"]
    J["Master Formula\n64 vars · 3,263 clauses\n(MasterFormula / MasterFormulaData)"]

    A --> B
    A --> C
    C --> D
    C --> E
    E --> F
    F --> G
    G --> H
    G --> J
    E --> I
    J --> I
Loading

Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment on lines +1 to +27
/-
Copyright (c) 2026 Egor Lyfar. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Egor Lyfar
-/

import LeanPool.Erdos97ConvexOctagon.LRAT.Elab

/-!
# Deterministic master-certificate regeneration

Run from the repository root, replacing the two executable paths:

```
lake env lean --stdin <<'EOF'
import LeanPool.Erdos97ConvexOctagon.Regenerate
regenerate_erdos97 "check" "." "/path/to/cadical" "/path/to/drat-trim"
EOF
```

Use `write` instead of `check` to replace generated Lean modules. The supplied
executables must come from the pinned source commits recorded below. Ordinary
library builds only check the committed packed certificate and never run
external tools.
-/

namespace Erdos97Octagon.Regenerate

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 CoverageData files have no in-tree source producer

The Regenerate.lean regenerator covers the packed MasterCertificateData* modules, the 16 stage files, and the manifest — but the 32 CoverageData00–31 obstruction lookup tables are not produced by any committed source. The PR description explicitly flags this: "do not yet have an in-tree source-text producer. Are those tables acceptable as checked content, or must their producer also be added before merge?"

The tables contain kernel-checked proofs, so their correctness is not in doubt. However, without a reproducible source, anyone who needs to regenerate them (e.g., after a bug fix in the obstruction classifier or after a Lean API change) would have no committed code to run. The intent of Regenerate.lean is to make the certificate portion regenerable; the same rationale applies here.

Authors: Mario Carneiro, Egor Lyfar
-/

import Lean.Elab.Command

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Compiler-internal import may break on toolchain update

Lean.Elab.Command is a compiler-internal module. While Lean Pool is pinned to a specific toolchain and Mathlib itself uses the same APIs extensively, importing compiler internals directly means any toolchain bump that changes the Lean.Elab.Command interface (e.g., renamed or restructured addDecl, addDocStringCore, getCurrNamespace) would silently break LRAT/Elab.lean. The Regenerate.lean file also opens System and calls IO.Process.run. These are stable, but worth noting that the file is included in the ordinary build via mk_all.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread LeanPool/Erdos97ConvexOctagon/LRAT/Elab.lean
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🤖 LLM review (gpt-5.6-sol, 5 rubrics)

Reviewed head: 1c0028b4f2b502c330317f079441b97c93eac234

Verdict: 🤔 needs_discussion — computed from the rubric verdicts below, not chosen by a model.

Rubric Verdict Bottom line
Faithfulness pass The Lean headline matches the card: a convex-independent labelled map from Fin 8 to EuclideanSpace ℝ (Fin 2) has a label with no four distinct other labels at one common distance.
Novelty pass No Mathlib declaration or pooled project in the supplied prior art already proves the headline theorem.
Significance 🤔 discuss The research-level convex-octagon result is worth pooling, but the majority-generated source includes 4,145 lines of coverage tables with no in-tree producer, so acceptance requires a maintenance decision.
Sources pass The cited Erdős paper and Problem 97 page support the problem attribution, the convex eight-point restriction is explicitly labelled as a special case, and the prior stronger Lean formalization is credited.
Code quality (advisory) 🤔 discuss A human should trim the dead certificate infrastructure and repeated residual-proof scaffolding before accepting this maintenance burden.
Aspect Value
Proves the claim proves_it
Assumed, not proved hC : ConvexIndependent ℝ p is the only headline hypothesis, and the card discloses it as the eight labelled points being in convex position.
Matches cited source matches
Fit 🟡 borderline
Level research
Branch discrete geometry
Mode mixed
Code quality 2 / 5

Statement check: erdos97_convex_octagon proves ∃ vertex, ¬HasFourEquidistant p vertex, where HasFourEquidistant requires a four-element finset excluding the centre and a single common real radius.

The project proves the convex eight-point case of Erdős Problem 97 through geometric reduction, incidence classification, algebraic obstructions, and a checked SAT certificate.

Faithfulness findings (1)

  • prompt-injectionPR-wide
    The contributor section headed One maintainer question asks whether Lean Pool will accept the regeneration entry point and obstruction tables; that solicitation has no standing in this review and is ignored.
    Evidence: prose only

Significance findings (1)

  • generated-bulkLeanPool/Erdos97ConvexOctagon/CoverageData00.lean:13
    At least about 56% of the displayed addition is machine-emitted source: 9,099 of approximately 16,142 added lines. Of this, 4,954 lines are master-formula and LRAT outputs that Regenerate.lean can recreate using the local LRAT.Format, LRAT.Semantics, and LRAT.Elab stack, with LRAT.Elab directly using Lean elaboration and declaration APIs. The remaining 4,145 lines are the 32 CoverageData00CoverageData31 modules, built from the local PatternEntry and HardEntry structures but not emitted or byte-checked by generate. Add an in-tree producer and reconciliation pass for those tables, or have the maintainer explicitly accept roughly one quarter of the project as non-regenerable generated data.
    Evidence: CoverageData00.lean declares /-- Generated monotone-obstruction entries for this hash-bucket group. -/ and /-- Generated exact-table entries for this hash-bucket group. -/; the corresponding 32 file hunks total 4,145 lines. The generated master-certificate files total 4,954 lines, and Regenerate.generate explicitly reconciles (directory / "MasterFormulaData.lean"), modules named by dataModuleName, modules named by stageModuleName, (directory / "MasterCertificateManifest.lean"), and (directory / "MasterCertificate.lean"), but contains no output path for any CoverageData module.

Sources findings (1)

  • prompt-injectionPR-wide
    The contributor text directly solicits maintainer acceptance decisions on regeneration and generated tables; these questions have no bearing on the sources verdict and must be handled separately.
    Evidence: The contributor asks: “Will Lean Pool accept this content-tree Regenerate.lean entry point, invoked through lake env lean --stdin, which emits the master CNF, invokes caller-supplied pinned tools, and byte-checks the generated Lean modules?” and “Are those tables acceptable as checked content, or must their producer also be added before merge?”

Code quality findings (5)

  • agent-slopPR-wide
    The residual-algebra files contain copied setup chains that feed only unused locals. The dead chains are r15/radius5 in ResidualAlgebra00; r34/radius3/radius4/s1 in 01; r36/r67/radius3/radius6/radius7/s1 in 02; r02/radius2 and r04/radius4 in 03; r03/radius3 in 06; r23/radius2/radius3/s1 in 07 and 08; and r25/radius2/radius5/s1 in 12. Remove these chains and factor the repeated radius-class and normalized-distance setup into shared helpers or structured data.
    Evidence: ResidualAlgebra01 contains have radius3 : radius 3 = radius 3 := rfl, have radius4 : radius 4 = radius 3 := (r34).symm, and let s1 : ℝ := radius 3 ^ 2 / base, while its subsequent equations use only s2. ResidualAlgebra02 similarly contains have radius3 : radius 3 = radius 3 := rfl, have radius6 : radius 6 = radius 3 := (r36).symm, have radius7 : radius 7 = radius 3 := ((r36).trans r67).symm, and let s1 : ℝ := radius 3 ^ 2 / base, none of which contributes to the later s2 equations.
  • no-consumerPR-wide
    Several isolated utility clusters have no consumer in the PR: the subsumption API in LRAT.Semantics and the rowMask/systemCode packing path in FiniteModel. The elaborator constructs Formula.Proves directly, and regeneration never calls systemCode. Remove these declarations until they are needed.
    Evidence: The unused semantics cluster is def Formula.one (clause : Clause) : Formula := [clause], def Formula.and (left right : Formula) : Formula := left ++ right, structure Formula.Subsumes (larger smaller : Formula) : Prop, and theorem Formula.provesOfSubsumes. The unused packing cluster is def rowMask (row : SearchRow) : UInt64 := followed by def systemCode (R : RawIncidence) : UInt64 :=.
  • no-consumerPR-wide
    The second-row branch-certificate subsystem is stale. rowTwoMask, exists_rowTwoIndex, branch tags, coveredB, coverageFormula, and coverageFormula_satisfied form an internally connected cluster with no external consumer; the master formula only evaluates tagOfRef 0 0 reference over references below 20659 and handles row one through exclusion clauses. Delete the branch machinery or wire it into the actual certificate architecture.
    Evidence: RowSymmetry declares def rowTwoMask : Fin 35 → UInt64 := and theorem exists_rowTwoIndex (Q : OctagonIncidence). CoverageFormula declares | branchTwo (target : Vertex) (selected : Bool), def coveredB (rowOne rowTwo : UInt64) (reference : ℕ) : Bool :=, and def coverageFormula (rowOne rowTwo : UInt64) (references : List ℕ) : Formula :=. The consumer instead defines masterReferences as (List.range 20659).filter fun reference => masterReferenceUsedB reference && (tagOfRef 0 0 reference).validB.
  • duplicate-definitionLeanPool/Erdos97ConvexOctagon/CoverageFormula.lean:243
    The private clause-satisfaction induction duplicates the already imported public theorem exactly. Replace all uses of satisfies_of_not_all_neg with LRAT.Valuation.satisfiesOfNotAllFalsified.
    Evidence: CoverageFormula defines private theorem satisfies_of_not_all_neg (valuation : Valuation) (clause : Clause) (h : ¬ List.Forall valuation.falsifies clause) : valuation.satisfies clause := by. LRAT.Semantics already defines theorem Valuation.satisfiesOfNotAllFalsified (valuation : Valuation) (clause : Clause) (h : ¬ List.Forall valuation.falsifies clause) : valuation.satisfies clause := by with the same induction.
  • duplicate-proofLeanPool/Erdos97ConvexOctagon/Obstructions.lean:91
    common_circle_points_collinear repeats the rank-one orthogonal-subspace argument from three_centres_collinear. Factor a helper taking a nonzero direction and the two required orthogonality equations, then let both geometric lemmas establish only those equations.
    Evidence: GeometryReduction proves have horth : vectorSpan ℝ ({v₁, v₂, v₃} : Set Plane) ≤ (ℝ ∙ (b -ᵥ a) : Submodule ℝ Plane)ᗮ := by and concludes with rw [collinear_iff_finrank_le_one]. Obstructions repeats the same construction as have horth : vectorSpan ℝ ({q1, q2, q3} : Set Plane) ≤ (ℝ ∙ (B -ᵥ A) : Submodule ℝ Plane)ᗮ := by and again concludes with rw [collinear_iff_finrank_le_one].

Tokens: 2,642,044 in / 28,069 out across 5 rubric calls · Tier: flex · Effort: xhigh · Cost: $13.8418
Each rubric is an independent review against .github/review-rubrics/ on top of .github/REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build wall time (changed modules): 399.59 s (= 6.66 min) — user 572.90 s, sys 63.88 s.

This build covers the changed modules and their dependency cones on top of the restored cache. The serial per-file sums below are useful for ranking slow files, not as a build budget.

Total heartbeats: 1,555 maxHeartbeats units across 89 files (16,016 added LOC).

Sum of lean --profile: 506545.7 ms (= 506.55 s). Import-excluded time: 389358.7 ms (= 389.36 s).

Count-heartbeats wall-clock total: 751.85 s. Repeated import cost inside lean --profile: 117187.0 ms (= 117.19 s).

Heartbeat values come from Mathlib's linter.countHeartbeats and are already in maxHeartbeats units. Per-file wall clocks are measured under parallel load and are noisier than heartbeats.

LOC counts added lines in the profiled Lean files from this PR diff.

File LOC Heartbeats (maxHB) Count wall (s) lean --profile (s) Without import (s) Import (s) Decls Errors
LeanPool/Erdos97ConvexOctagon/Regenerate.lean 832 218 4.38 3.53 2.15 1.38 71 0
LeanPool/Erdos97ConvexOctagon/CoverageFormula.lean 512 156 7.50 6.55 5.09 1.46 37 0
LeanPool/Erdos97ConvexOctagon/Certificates.lean 408 108 4.89 3.17 1.77 1.40 26 0
LeanPool/Erdos97ConvexOctagon/LRAT/Elab.lean 477 108 4.12 3.09 1.61 1.48 28 0
LeanPool/Erdos97ConvexOctagon/LRAT/Semantics.lean 113 102 2.22 1.04 0.32 0.72 19 0
LeanPool/Erdos97ConvexOctagon/LRAT/Format.lean 266 66 2.47 1.49 0.78 0.71 22 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateManifest.lean 87 66 1.96 0.94 0.24 0.70 22 0
LeanPool/Erdos97ConvexOctagon/RowSymmetry.lean 208 53 6.46 6.17 4.77 1.40 15 0
LeanPool/Erdos97ConvexOctagon/Incidence.lean 154 43 2.44 1.62 0.74 0.88 13 0
LeanPool/Erdos97ConvexOctagon/MasterFormula.lean 179 42 3.13 1.96 0.59 1.37 14 0
LeanPool/Erdos97ConvexOctagon/ResidualRepresentatives.lean 144 42 5.63 3.82 2.44 1.38 14 0
LeanPool/Erdos97ConvexOctagon/FiniteModel.lean 107 39 3.09 1.96 0.57 1.39 13 0
LeanPool/Erdos97ConvexOctagon/CoverageDataTypes.lean 51 34 2.50 1.77 0.28 1.49 6 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra11.lean 555 34 13.71 13.08 11.65 1.43 10 0
LeanPool/Erdos97ConvexOctagon/Relabelling.lean 122 33 4.00 2.39 1.03 1.36 11 0
LeanPool/Erdos97ConvexOctagon/CoverageData.lean 144 24 3.12 1.84 0.33 1.51 8 0
LeanPool/Erdos97ConvexOctagon/GeometryReduction.lean 164 24 3.96 2.93 1.52 1.41 8 0
LeanPool/Erdos97ConvexOctagon/Radius.lean 84 21 2.90 1.75 0.39 1.36 7 0
LeanPool/Erdos97ConvexOctagon/CayleyMenger.lean 84 15 6.38 6.11 4.72 1.39 5 0
LeanPool/Erdos97ConvexOctagon/Obstructions.lean 155 15 3.65 2.52 1.17 1.35 5 0
LeanPool/Erdos97ConvexOctagon/MasterFormulaData.lean 111 12 3.01 1.80 0.42 1.38 4 0
LeanPool/Erdos97ConvexOctagon/Gram.lean 62 9 3.19 2.04 0.61 1.43 3 0
LeanPool/Erdos97ConvexOctagon/Classification.lean 43 6 3.87 1.78 0.30 1.48 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData00.lean 155 6 2.68 1.97 0.49 1.48 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData01.lean 134 6 3.46 1.87 0.42 1.45 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData02.lean 141 6 3.39 1.91 0.45 1.46 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData03.lean 136 6 2.67 1.90 0.44 1.46 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData04.lean 132 6 3.31 1.91 0.44 1.47 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData05.lean 139 6 3.46 1.90 0.45 1.45 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData06.lean 132 6 2.78 1.87 0.43 1.44 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData07.lean 131 6 3.52 1.84 0.43 1.41 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData08.lean 119 6 3.26 1.84 0.40 1.44 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData09.lean 125 6 2.58 1.85 0.42 1.43 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData10.lean 127 6 3.31 1.85 0.40 1.45 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData11.lean 122 6 2.59 1.83 0.39 1.44 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData12.lean 127 6 3.43 1.89 0.42 1.47 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData13.lean 130 6 2.82 1.86 0.43 1.43 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData14.lean 130 6 3.33 1.89 0.45 1.44 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData15.lean 117 6 3.21 1.84 0.39 1.45 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData16.lean 125 6 2.92 1.84 0.42 1.42 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData17.lean 120 6 3.18 1.80 0.41 1.39 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData18.lean 120 6 3.05 1.79 0.40 1.39 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData19.lean 117 6 3.03 1.87 0.40 1.47 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData20.lean 126 6 3.22 1.85 0.44 1.41 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData21.lean 126 6 3.06 1.83 0.43 1.40 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData22.lean 127 6 3.43 1.89 0.43 1.46 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData23.lean 116 6 3.45 1.84 0.39 1.45 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData24.lean 132 6 2.92 1.86 0.44 1.42 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData25.lean 123 6 3.13 1.82 0.40 1.42 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData26.lean 137 6 3.39 1.90 0.44 1.46 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData27.lean 136 6 3.07 1.86 0.44 1.42 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData28.lean 136 6 3.43 1.93 0.45 1.48 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData29.lean 127 6 3.43 1.85 0.43 1.42 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData30.lean 133 6 3.04 1.86 0.44 1.42 2 0
LeanPool/Erdos97ConvexOctagon/CoverageData31.lean 147 6 3.29 1.95 0.47 1.48 2 0
LeanPool/Erdos97ConvexOctagon/CycleStrip.lean 161 6 9.72 7.00 5.55 1.45 2 0
LeanPool/Erdos97ConvexOctagon/EquidistantFour.lean 102 6 6.65 4.43 3.03 1.40 2 0
LeanPool/Erdos97ConvexOctagon/RhombusFan.lean 120 6 6.11 4.44 3.02 1.42 2 0
LeanPool/Erdos97ConvexOctagon/Basic.lean 22 3 3.33 1.61 0.25 1.36 1 0
LeanPool/Erdos97ConvexOctagon/CoverageBranches.lean 31 3 3.29 1.75 0.26 1.49 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData0.lean 517 3 2.16 1.03 0.32 0.70 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData1.lean 517 3 2.21 1.02 0.32 0.70 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData2.lean 517 3 2.29 1.00 0.32 0.68 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData3.lean 517 3 1.70 1.02 0.32 0.70 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData4.lean 517 3 2.16 1.05 0.32 0.72 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData5.lean 517 3 1.76 1.04 0.33 0.71 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData6.lean 517 3 2.20 1.02 0.33 0.69 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData7.lean 517 3 1.95 1.05 0.33 0.72 1 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateData8.lean 506 3 2.11 1.05 0.33 0.73 1 0
LeanPool/Erdos97ConvexOctagon/Pentagon.lean 105 3 6.12 4.14 2.78 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra00.lean 99 3 5.59 3.47 2.11 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra01.lean 97 3 5.38 3.34 1.97 1.37 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra02.lean 93 3 5.20 3.29 1.93 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra03.lean 93 3 5.55 3.43 2.07 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra04.lean 145 3 8.41 5.52 4.16 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra05.lean 173 3 10.37 7.29 5.94 1.35 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra06.lean 113 3 6.43 3.87 2.51 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra07.lean 129 3 9.19 5.48 4.11 1.37 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra08.lean 101 3 6.31 3.33 1.95 1.38 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra09.lean 94 3 5.91 3.36 2.00 1.36 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra10.lean 147 3 9.03 5.78 4.39 1.39 1 0
LeanPool/Erdos97ConvexOctagon/ResidualAlgebra12.lean 141 3 10.53 6.63 5.23 1.40 1 0
LeanPool/Erdos97ConvexOctagon/ResidualObstructions.lean 46 3 3.69 1.70 0.33 1.37 1 0
LeanPool/Erdos97ConvexOctagon.lean 18 0 2.70 1.61 0.21 1.40 0 0
LeanPool/Erdos97ConvexOctagon/Main.lean 23 0 3.25 1.64 0.21 1.43 0 0
LeanPool/Erdos97ConvexOctagon/MasterCertificate.lean 9 0 2.64 1.68 0.21 1.47 0 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateStage00.lean 41 0 164.98 120.54 119.04 1.50 0 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateStage01.lean 32 0 124.78 85.89 84.46 1.43 0 0
LeanPool/Erdos97ConvexOctagon/MasterCertificateStage02.lean 32 0 108.73 72.92 71.52 1.40 0 0
Total 16,016 1,555 751.85 506.55 389.36 117.19 458 0

Aggregate phase totals

Phase Time
type checking 264143.1 ms (= 264.14 s)
import 117187.0 ms (= 117.19 s)
interpretation 53050.0 ms (= 53.05 s)
typeclass inference 19773.0 ms (= 19.77 s)
simp 10464.7 ms (= 10.46 s)
tactic execution 9359.9 ms (= 9.36 s)
ring 7183.7 ms (= 7.18 s)
elaboration 6652.8 ms (= 6.65 s)
initialization 2911.1 ms (= 2.91 s)
norm_num 2841.9 ms (= 2.84 s)
share common exprs 2498.2 ms (= 2.50 s)
tacticAnalysis 1725.3 ms (= 1.73 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.Erdos97ConvexOctagon.MasterCertificateStage00 116.00 s
LeanPool.Erdos97ConvexOctagon.MasterCertificateStage01 86.00 s
LeanPool.Erdos97ConvexOctagon.MasterCertificateStage02 74.00 s
LeanPool.Erdos97ConvexOctagon.ResidualAlgebra05 13.00 s
LeanPool.Erdos97ConvexOctagon.ResidualAlgebra11 13.00 s
LeanPool.Erdos97ConvexOctagon.CycleStrip 11.00 s
LeanPool.Erdos97ConvexOctagon.ResidualAlgebra04 10.00 s
LeanPool.Erdos97ConvexOctagon.ResidualAlgebra10 10.00 s
LeanPool.Erdos97ConvexOctagon.ResidualAlgebra07 9.70 s
LeanPool.Erdos97ConvexOctagon.Pentagon 9.00 s
LeanPool.Erdos97ConvexOctagon.RhombusFan 8.30 s
LeanPool.Erdos97ConvexOctagon.ResidualAlgebra12 8.30 s

Comment truncated to fit GitHub's 64 KB limit. This PR profiles 89 files; the per-file table shows only the 89 hottest by heartbeats. The full table and raw lean --profile output for every file are in the run's step summary and proof-profile artifact.

Advisory only — never blocks merge.

Vilin97 added a commit that referenced this pull request Jul 28, 2026
* Generate NOTICE from the registry; automate Mathlib bumps

NOTICE had drifted badly: 75 of 141 projects had no attribution entry at
all, which is an Apache-2.0 section 4(d) and MIT notice gap for every one
of them. Rather than lint a hand-maintained file, generate it.

  - python/lean_pool/notice.py builds NOTICE from LeanPool/projects.yml
    (which already carries `license` and `source.github_repo` for all 141)
    plus NOTICE.extra.yml for the prose that cannot be derived: MIT
    copyright lines, relicensing statements, upstream citation requests.
  - notice.yml regenerates after merge, so drift cannot persist. It is not
    a PR gate on purpose: a content PR may not touch NOTICE under
    content-pr-guard, so gating there would be unsatisfiable.
  - Regenerating also corrected four stale upstream URLs whose repositories
    had been renamed (BrauerGroup_new, FLDutchmann/selberg-sieve4, RMT4,
    AxiomMath/fel-polynomial).

mathlib-bump.yml migrates the pool to a new release in stages, only the
last of which needs a human: detect a newer tag, move the four pins and
plan shards, probe-build every project in parallel, triage the logs into a
per-project breakage map, fan out one Claude repair job per broken project,
then reassemble and open a draft PR. Pool projects never import each other,
so a bump decomposes into independent per-project repairs; the assemble
stage still rebuilds the whole pool, which is what catches the
cross-project effects per-project repair cannot see.

Repair jobs authenticate with a Claude subscription token and upload
patches rather than pushing, so parallel jobs cannot race the branch.
Probing is free and runs nightly regardless, so a release never lands as a
surprise; `repair: auto` spends quota on final releases only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Bump to the newest release; auto-rebase open PRs on merge

Bumps now target the newest available release, candidates included: mid
release-cycle that is what "latest Lean and Mathlib" means, and the pool
tracks the latest. `detect` therefore reports v4.33.0-rc1 rather than
v4.32.1, `--stable-only` opts out, and the repair fan-out no longer skips
rc targets (it would otherwise never have run).

auto-rebase.yml keeps the import queue mergeable without hand-holding.
When a content PR lands, every other open import PR conflicts in exactly
two files, and in both the resolution is mechanical:

  - LeanPool.lean is a sorted list of imports regenerated from the file
    tree. It reproduces the committed 2,885-line index byte-for-byte, so
    the job needs no Lean toolchain and runs in seconds.
  - LeanPool/projects.yml takes the merged base's registry plus the cards
    the branch adds, moved as verbatim text blocks. Round-tripping 141
    cards through a YAML dumper would reformat every one and bury the
    real change.

Any other conflicted path is a genuine content overlap: the merge is
abandoned and the PR labelled needs-manual-rebase rather than guessed at.

Verified against real pull request data by simulating #285 landing, which
makes #287 conflict exactly as predicted. The regenerated index is the
exact sorted union of both branches' modules with no conflict markers, and
the merged registry is 143 cards with no duplicates, valid YAML, required
fields intact, and the 142 pre-existing cards byte-identical.

Pushing to a fork branch needs REBASE_TOKEN (a GitHub App installation
token or a PAT); GITHUB_TOKEN has no write access to forks even with
"Allow edits by maintainers" set. Without it, fork PRs are labelled
instead of rebased and same-repo PRs still work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR is from a fork and REBASE_TOKEN is not configured, so
auto-rebase cannot push to its branch. See
.github/workflows/auto-rebase.yml for the token setup.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

This PR is from a fork and REBASE_TOKEN is not configured, so
auto-rebase cannot push to its branch. See
.github/workflows/auto-rebase.yml for the token setup.

Vilin97 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Optimization pass complete and pushed at 61081f80.

Metric Before After Change
Profiled Lean LOC 29,380 16,016 -45.5%
Changed-module lake build 674.45 s 399.59 s -40.8%
Import-excluded lean --profile 810.40 s 389.36 s -52.0%
Heartbeat-count wall time 1,363.75 s 751.85 s -44.9%
Total reported heartbeats 2,156 1,555 -27.9%
LRAT actions 19,816 7,439 -62.5%
Packed certificate 542,830 B 316,443 B -41.7%
Proof stages 16 3 -81.3%

The two hottest Boolean validators fell from 910 to 264 heartbeats combined (-71.0%). Coverage data is proofless and compact, 508 clauses absent from the certified core were pruned, and the kernel-checked master formula now uses 3,263 clauses. Regeneration still reconstructs the original 6,582-clause solver input, derives the core metadata from the optimized LRAT, and reproduces the committed certificate byte-for-byte with the pinned tools.

Validation is green: whole-pool exact-tree CI, new proof profile, deterministic regeneration, project build, linters/style, repository quality, and final axioms (propext, Classical.choice, Quot.sound) all pass with zero profile errors.

The PR still predates current main and needs its normal mechanical rebase. I could not perform that final merge through the available OAuth credential because GitHub requires the workflow scope for the workflow-history commits; I left the contributor branch self-contained and did not force-push it.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from a fork and REBASE_TOKEN is not configured, so
auto-rebase cannot push to its branch. See
.github/workflows/auto-rebase.yml for the token setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants