Skip to content

chore: bump Lean and Mathlib to v4.36.0 - #417

Merged
alexanderlhicks merged 2 commits into
mainfrom
chore/bump-v4.36.0
Nov 18, 2026
Merged

alexanderlhicks merged 2 commits into
mainfrom
chore/bump-v4.36.0

Conversation

@alexanderlhicks

Copy link
Copy Markdown
Collaborator

Moves CompPoly from Lean and Mathlib v4.35.0 to v4.36.0.

Pins

  • lean-toolchain: leanprover/lean4:v4.36.0.
  • lakefile.lean: Mathlib v4.36.0.
  • lake-manifest.json: regenerated by lake update. The inherited packages are at the revisions Mathlib v4.36.0 pins.

Source fixes

Most fixes follow from one Mathlib change: Polynomial R is now an abbrev for AddMonoidAlgebra R ℕ. The constant Polynomial.coeff is gone, p.coeff resolves to AddMonoidAlgebra.coeff p : ℕ →₀ R, and several coefficient lemmas changed form.

  • Polynomial.coeff q i is now written q.coeff i. The term means the same thing. This touches the statements of finSuccEquivNth_coeff_coeff, support_coeff_finSuccEquivNth, image_support_finSuccEquivNth and degreeOf_coeff_finSuccEquivNth in ToMathlib/MvPolynomial/Equiv.lean, and local haves in Bivariate/ToPoly.lean, Data/Polynomial/MonomialBasis.lean, Fields/Binary/Tower/Support/Preliminaries.lean and PMBasis/KernelLeafSoundness.lean.
  • Polynomial.coeff_monomial now states (monomial n r).coeff = Finsupp.single n r. Proofs that rewrote with it to an if use Polynomial.coeff_monomial_apply (ToPoly/Impl.lean, CoreCorrectness.lean, PolynomialCorrectness.lean, ModularData.lean, Divisibility.lean), or add Finsupp.single_apply to the simp set (Bivariate/ToPoly.lean).
  • p - q on polynomials no longer unfolds to p + -q by change. Raw.toPoly_sub, toPoly_sub (ToPoly/Equiv.lean) and lowEq.sub (DivisionCorrectness.lean) use sub_eq_add_neg.
  • BivariateDegree.lean: the body of evalX builds the polynomial with AddMonoidAlgebra.ofCoeff directly, since Polynomial no longer has its own constructor. Its type is unchanged. A simpa became rw because simp now rewrites the sum coefficient first.
  • Protected or renamed lemmas: coeff_one_zero and coeff_smul become AddMonoidAlgebra.coeff_one_zero and AddMonoidAlgebra.coeff_smul_apply.
  • Deprecated Polynomial.ext, Polynomial.ofFinsupp and Polynomial.toFinsupp: apply Polynomial.ext; intro n becomes ext n : 2, and the wrappers are dropped.

Other upstream changes:

  • Nat.strong_induction_on names its motive motive and its case ind (was p and h). Updated in Univariate/Basic.lean and in nine induction ... using Nat.strong_induction_on blocks.
  • natDegree_X_pow_sub_C takes a explicitly (Fields/Extension/{Defs,Binomial}.lean).
  • orderOf_eq_of_pow_and_pow_div_prime no longer needs 0 < n. The proof of KoalaBear.primitiveRoot_order drops that goal.
  • FiniteField.X_pow_card_sub_X_ne_zero and X_pow_card_sub_X_natDegree_eq are replaced by Polynomial.X_pow_sub_X_ne_zero and Polynomial.natDegree_X_pow_sub_X (Shoup/FrobeniusLinear.lean, LasVegas/Probability/OddTrial.lean).
  • ENNReal.tsum_le_tsum and ENNReal.tsum_eq_add_tsum_ite are replaced by the general tsum_le_tsum and tsum_eq_add_tsum_ite. Three call sites add dsimp only, because the general lemma states f ≤ g and leaves a beta-redex after intro.

Warning cleanup:

  • natDegree_mem_support_of_nonzero becomes natDegree_mem_support_of_ne_zero, and Set.Ico_insert_right becomes Set.insert_right_Ico.
  • contrapose! becomes contrapose where push Not made no progress (Finsupp/Fin.lean, Bivariate/ToPoly.lean, BF128Ghash/Impl.lean).
  • Unused simp arguments, try, all_goals and any_goals reported by the linters are removed or replaced (Fields/Basic.lean, CanonicalNat.lean, Raw/Proofs.lean, Intermediate.lean, NovelPolynomialBasis.lean, MvPolynomial/Equiv.lean, DivisionCorrectness.lean).
  • Barycentric.lean: the private eval_off_node_eq drops its hypothesis hn : 0 < n, which the proof no longer uses.

No public statement changes other than the Polynomial.coeff spelling above. No new sorry, axiom or native_decide. The only new linter exceptions are the two described below.

New linter

Mathlib's new concreteInstances linter flags card_bf64 [Fintype BF64] (BF64/Impl.lean) and card_ext3 [Fintype Ext3] (BF64/Ext3.lean). Neither type has a global Fintype instance, and both theorems are stated for any enumeration. The tests use them in that form. Removing the binder would change their statements, so each theorem gets a scoped set_option linter.concreteInstances false in with a comment. Without it, lake build --wfail CompPolyNativeSmoke fails in CI.

Validation

Run locally on Linux x86_64, after lake exe cache get:

  • lake build --wfail and lake test pass with no warnings.
  • lake build --wfail CompPolyNativeSmoke passes, and the binary passes under the CI limits (ulimit -v 4194304, LEAN_NUM_THREADS=1, 30 s timeout).
  • lake exe axiomsweep --check: 10981 declarations, none sorry-tainted, no non-standard axioms.
  • lake exe CompPolyBench --medium --validate-only on the groups in bench/ci-groups.txt: 276 records in 69 groups validated.
  • scripts/lint-style.py on the changed files, scripts/check-imports.sh, scripts/check-docs-integrity.py and scripts/check-writing.py pass.

🤖 Generated with Claude Code

Moves the toolchain and the Mathlib pin to v4.36.0 and adapts the sources.
Most fixes follow from Mathlib making `Polynomial R` an abbrev for
`AddMonoidAlgebra R ℕ`. See the PR description for the full list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Summary

ℹ️ This PR modifies 4 file(s) under CompPoly/ToMathlib/ — consider whether a corresponding upstream PR is needed.

Mechanical Bump to Lean and Mathlib v4.36.0

All modifications in this PR are purely mechanical adaptations required to compile the CompPoly/ library against Lean and Mathlib v4.36.0. No new mathematical content is introduced aside from one strengthened lemma and one new cardinality theorem. No new sorry or admit placeholders are introduced.

Library Version Pins

  • lean-toolchain: updated to leanprover/lean4:v4.36.0.
  • lakefile.lean: Mathlib dependency pinned to v4.36.0.
  • lake-manifest.json: regenerated by lake update, inheriting package revisions from Mathlib's v4.36.0 pins.

Mathematical Formalization / Proof Adaptation

Upstream Change: Polynomial is now an abbrev for AddMonoidAlgebra R ℕ

This single Mathlib change drives most source fixes. Specifically:

  • Polynomial.coeff is removed; p.coeff now resolves to AddMonoidAlgebra.coeff p : ℕ →₀ R.
  • .coeff notation replaces Polynomial.coeff in statements and proofs across multiple files, including MvPolynomial/Equiv.lean (statements of finSuccEquivNth_coeff_coeff, support_coeff_finSuccEquivNth, image_support_finSuccEquivNth, degreeOf_coeff_finSuccEquivNth), Bivariate/ToPoly.lean, Data/Polynomial/MonomialBasis.lean, Fields/Binary/Tower/Support/Preliminaries.lean, and PMBasis/KernelLeafSoundness.lean.
  • Polynomial.coeff_monomial now states (monomial n r).coeff = Finsupp.single n r. Proofs that rewrote with it to an if use Polynomial.coeff_monomial_apply (in ToPoly/Impl.lean, CoreCorrectness.lean, PolynomialCorrectness.lean, ModularData.lean, Divisibility.lean), or add Finsupp.single_apply to the simp set (Bivariate/ToPoly.lean).
  • p - q on polynomials no longer unfolds to p + -q by change. Raw.toPoly_sub, toPoly_sub (ToPoly/Equiv.lean) and lowEq.sub (DivisionCorrectness.lean) now use sub_eq_add_neg.
  • BivariateDegree.lean: the body of evalX builds the polynomial with AddMonoidAlgebra.ofCoeff directly, since Polynomial no longer has its own constructor. A simpa became rw because simp now rewrites the sum coefficient first.
  • Protected or renamed lemmas: coeff_one_zero and coeff_smul become AddMonoidAlgebra.coeff_one_zero and AddMonoidAlgebra.coeff_smul_apply.
  • Deprecated Polynomial.ext, Polynomial.ofFinsupp and Polynomial.toFinsupp: apply Polynomial.ext; intro n becomes ext n : 2, and the wrappers are dropped.

Other Upstream Changes

  • Nat.strong_induction_on now names its motive motive and its case ind (was p and h). This is updated in Univariate/Basic.lean and in nine induction ... using Nat.strong_induction_on blocks across Combinations.lean, Alekhnovich/Correctness.lean, Abstract/Algebra.lean, Concrete/Algebra.lean, Concrete/Field.lean, CoefficientInterpolation.lean, and Basic.lean (Univariate).
  • natDegree_X_pow_sub_C now requires an explicit underscore argument; updated in Fields/Extension/Defs.lean and Fields/Extension/Binomial.lean.
  • orderOf_eq_of_pow_and_pow_div_prime no longer needs 0 < n. The proof of KoalaBear.primitiveRoot_order drops that arithmetic subgoal.
  • FiniteField.X_pow_card_sub_X_ne_zero and X_pow_card_sub_X_natDegree_eq are replaced by Polynomial.X_pow_sub_X_ne_zero and Polynomial.natDegree_X_pow_sub_X (Shoup/FrobeniusLinear.lean, LasVegas/Probability/OddTrial.lean).
  • ENNReal.tsum_le_tsum and ENNReal.tsum_eq_add_tsum_ite are replaced by the general tsum_le_tsum and tsum_eq_add_tsum_ite. Three call sites add dsimp only because the general lemma states f ≤ g and leaves a beta-redex after intro. This affects six files in Probability/ and Basic.lean.

Strengthened Lemma

  • BarycentricDomain.eval_off_node_eq (in Barycentric.lean): the hypothesis 0 < n is no longer required, making the lemma hold unconditionally.

New Theorem

  • card_ext3 (in BF64/Ext3.lean): states Fintype.card Ext3 = 2 ^ 192 for any [Fintype Ext3] instance. A scoped set_option linter.concreteInstances false in is added, since the type has no global Fintype instance. The proof compiles and the linter exception is necessary to pass lake build --wfail CompPolyNativeSmoke.

Proof Style Refactors (Cosmetic)

Polish Fixes

  • contrapose! becomes contrapose where push Not made no progress (Finsupp/Fin.lean, Bivariate/ToPoly.lean, BF128Ghash/Impl.lean).
  • Unused simp arguments, try, all_goals and any_goals reported by linters are removed or replaced (Fields/Basic.lean, CanonicalNat.lean, Raw/Proofs.lean, Intermediate.lean, NovelPolynomialBasis.lean, MvPolynomial/Equiv.lean, DivisionCorrectness.lean). In Raw/Proofs.lean, any_goals is replaced by on_goal 3.

No Public Statement Changes

Other than the .coeff spelling updates noted above, no public theorem signatures or API are changed. No new sorry, axiom, or native_decide are introduced.

New Linter Exception

  • card_bf64 [Fintype BF64] (BF64/Impl.lean) and card_ext3 [Fintype Ext3] (BF64/Ext3.lean) each get a scoped set_option linter.concreteInstances false in with a comment to suppress Mathlib's new concreteInstances linter. Neither type has a global Fintype instance, and both theorems are stated for any enumeration; removing the binder would change their statements. Without the option, lake build --wfail CompPolyNativeSmoke fails in CI.

Warning Cleanup

  • natDegree_mem_support_of_nonzero becomes natDegree_mem_support_of_ne_zero, and Set.Ico_insert_right becomes Set.insert_right_Ico (NovelPolynomialBasis.lean). Additionally, Set.Ico_insert_right → Set.insert_right_Ico and an extra occurrence of the rename `` appears in BivariateDegree.lean `degreeX_swap`.

Validation (from PR body)

  • lake build --wfail and lake test pass with no warnings.
  • lake build --wfail CompPolyNativeSmoke passes, and the binary passes under CI limits.
  • lake exe axiomsweep --check: 10981 declarations, none sorry-tainted, no non-standard axioms.
  • lake exe CompPolyBench --medium --validate-only on the groups in bench/ci-groups.txt: 276 records in 69 groups validated.
  • Style and import scripts pass.

Statistics

Metric Count
📝 Files Changed 56
✅ Lines Added 139
❌ Lines Removed 138

Lean Declarations

✏️ Affected: 1 declaration(s) (line number changed)
  • @[simp] theorem natDegree_poly : P.poly.natDegree = P.d in CompPoly/Fields/Extension/Defs.lean moved from L67 to L67

sorry Tracking

  • No sorrys were added, removed, or affected.

📋 **Additional Analysis**

No findings.


📄 **Per-File Summaries**
  • CompPoly/Bivariate/Deriv.lean: Two proofs in CompPoly/Bivariate/Deriv.lean were refactored to use the ext tactic with an explicit : 2 binder instead of explicitly opening Polynomial.ext with intro j. In partialDerivX_mul, the line apply Polynomial.ext; intro j was replaced by ext j : 2. In shiftX_toPoly, the lines apply Polynomial.ext and intro j were collapsed into a single ext j : 2. This changes only the proof style, not the stated theorems or their signatures.
  • CompPoly/Bivariate/Factor.lean: In divByLinearY_spec, the proof is refactored by replacing apply Polynomial.ext and intro n with the single call ext n : 2. This change shortens the proof without altering the theorem's statement or its logical content.
  • CompPoly/Bivariate/GuruswamiSudan/CoreCorrectness.lean: Refactored the proof of coeff_coeffwise_hasseDeriv_sum to use Polynomial.coeff_monomial_apply instead of the now-removed lemma Polynomial.coeff_monomial. All three invocations of coeff_monomial in the proof were replaced, adapting to an API change in Mathlib (the coeff_monomial lemma was removed or renamed in favor of coeff_monomial_apply). No sorry or admit were introduced.
  • CompPoly/Bivariate/GuruswamiSudan/Interpolation/ApproximantBasis/ModularData.lean: The diff refactors three uses of Polynomial.coeff_monomial to Polynomial.coeff_monomial_apply in the proof of the private theorem toPoly_ofCoeffRow_eq_sum. The new lemma coeff_monomial_apply is presumably a more convenient or correctly-typed form of the existing coeff_monomial; this is a purely mechanical replacement that does not affect the statement of the theorem or any other declarations in the file. No sorry or admit is introduced.
  • CompPoly/Bivariate/GuruswamiSudan/Interpolation/Correctness.lean: The proof of hasseDerivative_zero_xOrder_toPoly_of_map_C was refactored: two nested calls to Polynomial.ext with explicit intro binders were replaced by a single ext j : 2 followed by an ext i : 2. This uses Lean's ext tactic with depth arguments, making the goal expansion more concise without changing the subsequent rewriting steps.
  • CompPoly/Bivariate/GuruswamiSudan/Interpolation/LeeOSullivan/Correctness/Combinations.lean: In hasseDerivativeEval_ofYConstant_mul_eq_eval_mul_of_lower, the induction binder in the Nat.strong_induction_on block was renamed from h n ih to ind n ih. This is a purely cosmetic refactor that does not affect the theorem's statement, proof structure, or any other declaration in the file.
  • CompPoly/Bivariate/GuruswamiSudan/Interpolation/LeeOSullivan/Correctness/Divisibility.lean: In the private theorem lee_coeff_coeffwise_hasseDeriv_sum, three uses of Polynomial.coeff_monomial were replaced with Polynomial.coeff_monomial_apply. This updates the proof to match a renamed lemma in the polynomial library and does not alter the theorem's logical content.
  • CompPoly/Bivariate/GuruswamiSudan/PolynomialCorrectness.lean: In the private lemma coeff_coeffwise_hasseDeriv_sum, three uses of Polynomial.coeff_monomial are replaced by Polynomial.coeff_monomial_apply in order to adapt to a change in Mathlib's API (the lemma coeff_monomial has been renamed or superseded by coeff_monomial_apply). The theorem statement and the overall logic of the proof remain unchanged; the adjustment is purely mechanical to keep the proof compiling against the current Mathlib revision.
  • CompPoly/Bivariate/GuruswamiSudan/Root/Alekhnovich/Correctness.lean: Renamed the strong induction case binder in alekhnovichRootCandidatesWithFuel_complete from h fuel ih to ind fuel ih for consistency with the naming convention used elsewhere in the project.
  • CompPoly/Bivariate/ToPoly.lean: The diff refines several lemmas in ToPoly.lean:
  • In ofPoly_monomial, support_toPoly_outer, evalX_toPoly_coeff, and evalX_toPoly_eval_commute_converse, the simp calls are supplemented with Finsupp.single_apply to improve simplification of monomial coeffs.
  • ofPoly_coeff rewrites Polynomial.toImpl (Polynomial.coeff p j) as Polynomial.toImpl (p.coeff j) for brevity.
  • ofPoly_add and evalX_toPoly_eval_commute replace contrapose! with contrapose, altering the structure of a case analysis.
  • toPoly_eq_map changes its convert target from Polynomial.ext _ to AddMonoidAlgebra.ext (Finsupp.ext _), adjusting to a lower-level extension lemma.
  • natDegreeY_toPoly updates the lemma name from Polynomial.natDegree_mem_support_of_nonzero to Polynomial.natDegree_mem_support_of_ne_zero.
  • toPoly_eq_map, evalX_toPoly_coeff, and evalX_toPoly_eval_commute_converse add Finsupp.single_apply to simp expressions that already used Polynomial.coeff_monomial.
  • CompPoly/Data/Classes/CanonicalNat.lean: The all_goals assumption tactic block in the proof of ofNat?_eq_none_iff is replaced by a single assumption call. Since the split reduces the goal to a single case (the none branch of ofNat?), the all_goals combinator was unnecessary and this change simplifies the proof without affecting the theorem's statement or its logical content.
  • CompPoly/Data/Polynomial/MonomialBasis.lean: The proof of monomialBasisOfDegreeLT was updated to fix the application of coeff after a recent API change. Previously, the expression coeff (Finsupp.linearCombination ...).val i was used, but coeff now expects the polynomial type directly, not a Subtype projection. The lemma now writes .val.coeff i to access the coefficient, and the simp block was updated to use AddMonoidAlgebra.coeff_smul_apply (likely replacing a now-unavailable coeff_smul lemma), keeping the reasoning step correct. No sorry or admit were introduced.
  • CompPoly/Fields/Basic.lean: This diff removes two try markers in the comp_x_square_coeff_pos_deg lemma, changing try simp [←mul_assoc] and try simp_all to plain simp and simp_all. Both are in branches of rintro that match specific patterns, so the try was redundant — the simp calls now always apply without fallback.
  • CompPoly/Fields/Binary/AdditiveNTT/Intermediate.lean: In Intermediate.lean, the map_add' and map_smul' proofs of intermediateToCoeffsVec were simplified by removing the explicit coeff_add and coeff_smul lemmas from their simp calls, relying on a more general simp rewrite. The proof of intermediateEvaluationPoly_from_inovel_coeffs_eq_self was refactored to use ext k : 2 (a two-level ext tactic) instead of the separate apply Polynomial.ext followed by intro k, streamlining the extensionality application. No new theorems, definitions, or sorry/admit were introduced.
  • CompPoly/Fields/Binary/AdditiveNTT/NovelPolynomialBasis.lean: The file makes three changes. First, it replaces Set.Ico_insert_right with Set.insert_right_Ico in the proof of U_i_is_union_of_cosets (line 156) and in the proof of root_U_lift_down (line 223), likely to reflect a rename of that lemma in Mathlib. Second, it simplifies the map_add' proof of toCoeffsVec by removing the explicit coeff_add invocation (line 1407). Third, it updates the map_smul' proof of toCoeffsVec (line 1410) to use AddMonoidAlgebra.coeff_smul_apply in place of Polynomial.coeff_smul, adapting to a change in how polynomial multiplication by scalars is expressed in the polynomial representation.
  • CompPoly/Fields/Binary/BF128Ghash/Impl.lean: In mul_inv_cancel (which proves a * a⁻¹ = 1 for nonzero a), the subproof establishing h_quot_ne_zero : toQuot a ≠ 0 was changed from using contrapose! h to using contrapose h. This is a minor proof refactor; the lemma statement and overall theorem remain unchanged.
  • CompPoly/Fields/Binary/BF64/Ext3.lean: Added theorem card_ext3 establishing that for any [Fintype Ext3] instance, Fintype.card Ext3 = 2 ^ 192, complementing the existing nat_card_ext3. The set_option linter.concreteInstances false attribute suppresses the linter warning because the theorem is stated for an arbitrary enumeration rather than a specific global instance.
  • CompPoly/Fields/Binary/BF64/Impl.lean: Added a set_option linter.concreteInstances false pragma immediately before the existing card_bf64 theorem, together with a comment explaining that the theorem is stated for any enumeration because BF64 has no global Fintype instance. This change suppresses the linter's warning about a potentially non-concrete instance, clarifying that the [Fintype BF64] parameter is intentional and not an oversight.
  • CompPoly/Fields/Binary/Tower/Abstract/Algebra.lean: The diff renames the induction hypothesis binder h r ih_r to ind r ih_r in both towerAlgebraMap_succ_last and towerAlgebraMap_assoc. These renames affect only the binder name used in the induction block; the statements, proofs, and logic of both theorems remain unchanged.
  • CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean: The diff renames the induction case binder from h r ih_r to ind r ih_r in both concreteTowerAlgebraMap_succ_last and concreteTowerAlgebraMap_assoc. No other changes are made; the proofs, statements, and sorry/admit counts remain unaffected.
  • CompPoly/Fields/Binary/Tower/Concrete/Basis.lean: The proof of minPoly_of_powerBasisSucc_generator is refactored: in the subproof establishing that c equals q.leadingCoeff, the call q.toFinsupp.coeff is replaced by the more direct q.coeff. This simplifies the expression without affecting the theorem's statement or overall correctness.
  • CompPoly/Fields/Binary/Tower/Concrete/Field.lean: Renamed the induction case binder from h to ind in both concrete_pow_base_one and concrete_pow_nat_eq_pow, aligning with a project-wide convention for Nat.strong_induction_on induction hypotheses. No new theorems, definitions, or proofs were added; no sorry or admit were introduced.
  • CompPoly/Fields/Binary/Tower/Support/DefiningPoly.lean: The proof of definingPoly_coeffOf0 was updated to replace the lemma coeff_one_zero with AddMonoidAlgebra.coeff_one_zero in its simp call. No new theorems, definitions, or sorry blocks were introduced; the change is a minor cleanup to use a more specific lemma name.
  • CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean: In CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean, the local binding a in the proof of is_unit_iff_deg_0 was changed from coeff p 0 to p.coeff 0. This is a purely cosmetic refactor, replacing a standalone coeff call with the equivalent dot-notation method call on the polynomial p. No new theorems, definitions, or signatures were added or removed, and no sorry or admit were introduced.
  • CompPoly/Fields/Extension/Binomial.lean: In CompPoly/Fields/Extension/Binomial.lean, the proof of irreducible_X_pow_sub_C_iff is corrected by updating the call to natDegree_X_pow_sub_C to provide an explicit argument (underscore) instead of the prior no-argument invocation. This fixes a type mismatch or ambiguity in the lemma application, ensuring the h_deg hypothesis correctly states that the natDegree of X ^ d - C W equals d.
  • CompPoly/Fields/Extension/Defs.lean: The proof of the natDegree_poly theorem changed: natDegree_X_pow_sub_C is now applied with an explicit argument (natDegree_X_pow_sub_C _) instead of relying on implicit application. This adjusts the invocation of the lemma to match Lean's expected syntax or a binding update.
  • CompPoly/Fields/KoalaBear/Basic.lean: The proof of primitiveRoot_order was refactored: the call to orderOf_eq_of_pow_and_pow_div_prime now takes only two subgoals instead of three, removing the arithmetic subgoal that previously used omega after unfolding fieldSize. The power condition (ZMod.pow_card_sub_one_eq_one) and the primality condition remain, simplifying the proof by eliminating an explicit fieldSize-related calculation.
  • CompPoly/LinearAlgebra/PolynomialMatrix/Approximant/PMBasis/KernelLeafSoundness.lean: In KernelLeafSoundness.lean, a single equality in the proof of coefficientMatrixRows_dot_eq_zero_of_approximates is refactored. The LHS expression Polynomial.coeff ((rowGet row k).toPoly * (rowGet (problem.matrix.getD k #[]) j).toPoly) t is rewritten as ((rowGet row k).toPoly * (rowGet (problem.matrix.getD k #[]) j).toPoly).coeff t, using the .coeff notation instead of the Polynomial.coeff function. This is a purely stylistic or API-consistency change that does not alter the theorem's statement or logical content.
  • CompPoly/LinearAlgebra/PolynomialMatrix/Approximant/PMBasis/XAdicSoundness.lean: The diff makes two changes: in polynomialScaleCoeffX_toPoly, the Polynomial.ext block is replaced with ext t : 2; similarly in coeffXPower_toPoly, Polynomial.ext is replaced with ext t : 2. Both changes are purely stylistic or syntactic, swapping legacy Polynomial.ext for the shorter ext t : 2 form while preserving the same underlying proof structure.
  • CompPoly/ToMathlib/Finsupp/Fin.lean: Updated the snoc_ne_zero_of_left, snoc_ne_zero_of_right, insertNth_ne_zero_of_left, and insertNth_ne_zero_of_right theorems to use contrapose instead of contrapose!, changing the forward direction of the negated assumption from a direct equality to a hypothesis introduced with with c. No other modifications were made.
  • CompPoly/ToMathlib/MvPolynomial/Equiv.lean: This diff performs a series of syntactic refactors in CompPoly/ToMathlib/MvPolynomial/Equiv.lean, replacing the notation Polynomial.coeff ((finSuccEquivNth R p) f) i with the simpler (finSuccEquivNth R p f).coeff i across six theorems: finSuccEquivNth_coeff_coeff, support_coeff_finSuccEquivNth, image_support_finSuccEquivNth, degreeOf_coeff_finSuccEquivNth, and their associated proofs (including removing a now-unnecessary Polynomial.coeff_add in the add case of finSuccEquivNth_coeff_coeff). There are no new theorems, definitions, or sorries; the change only updates the API surface to use the more direct .coeff i notation on the polynomial-valued result of finSuccEquivNth.
  • CompPoly/ToMathlib/Polynomial/BivariateDegree.lean: Replaced two occurrences of Polynomial.natDegree_mem_support_of_nonzero with Polynomial.natDegree_mem_support_of_ne_zero (a renaming upstream) in the proofs of natWeightedDegree_mem_weight_list and weight_le_natWeightedDegree_of_lt_natDegree_succ, and one further occurrence in the proof of degreeX_swap. Simplified the evalX definition and its associated lemma evalX_eq_map by removing an explicit f.toFinsupp.coeff indirection in favor of f.coeff and dropping a classical block. In natDegree_sum_eq_of_unique, changed the simpa showing (∑ x ∈ s, f x).coeff deg ≠ 0 into an explicit rw followed by exact hmx_coeff_ne0.
  • CompPoly/ToMathlib/Polynomial/BivariateWeightedDegree.lean: The proof of natWeightedDegree_smul_le was updated: the simp block now uses AddMonoidAlgebra.coeff_smul_apply instead of coeff_smul. The statement and behavior of the lemma remain unchanged.
  • CompPoly/Univariate/Barycentric.lean: The private theorem BarycentricDomain.eval_off_node_eq has been strengthened by removing the hypothesis hn : 0 < n and the corresponding proof term ⟨ ⟨ 0, hn ⟩, Finset.mem_univ _ ⟩ from its proof. Consequently, the call to eval_off_node_eq in the proof of theorem BarycentricDomain.eval_eq_interpolate_eval is updated to drop the Nat.succ_pos n argument. This makes the correctness of the barycentric formula for off-node evaluation hold unconditionally rather than requiring a nonempty index set Fin n.
  • CompPoly/Univariate/Basic.lean: The diff updates the call to Nat.strong_induction_on inside theorem induction_on by renaming the named argument from p to motive. This is a purely syntactic refactor—likely to align with a change in the Nat.strong_induction_on signature—and does not alter the theorem’s statement or its logic.
  • CompPoly/Univariate/CoefficientInterpolation.lean: This commit changes the binder name in the divByLinearFactor_eq_divByMonic theorem's Nat.strong_induction_on case from | h m ih => to | ind m ih =>. This is a purely syntactic/renaming change—the binder in the induction case is now called ind instead of h, with no changes to the proof body or the theorem's statement.
  • CompPoly/Univariate/Deriv.lean: The proof of derivative_toPoly is simplified: the explicit Polynomial.ext + intro n is replaced by the shorter ext n : 2. The simp block is otherwise unchanged, so the theorem's statement and meaning are unaffected; this is purely a proof-style refactor.
  • CompPoly/Univariate/DivisionCorrectness.lean: In lowEq.sub, the proof now rewrites p₁ - p₂ and q₁ - q₂ as p₁ + (-p₂) and q₁ + (-q₂) via sub_eq_add_neg before applying h₁.add h₂.neg, making the lemma directly rely on lowEq.add. In lowEq.newton_step, the simp call in the proof of h_e was simplified by removing Polynomial.coeff_sub, keeping only hcoeff, which still suffices since hcoeff already equates the relevant coefficients.
  • CompPoly/Univariate/EuclideanAlgorithm.lean: In CompPoly/Univariate/EuclideanAlgorithm.lean, the body of Raw.toPoly_smul is modified: Polynomial.coeff_smul is replaced by AddMonoidAlgebra.coeff_smul_apply to correctly use the additive monoid algebra (Laurent polynomial) coercion underlying the CPolynomial.Raw structure. The proof still ends by applying CPolynomial.Raw.smul_coeff. No new sorry or admit is introduced.
  • CompPoly/Univariate/Quotient/Equiv.lean: In the ringEquiv definition, the proof of map_mul' was updated: the original Polynomial.ext (Raw.toPoly_mul_coeff p q) was replaced with AddMonoidAlgebra.ext (Finsupp.ext (Raw.toPoly_mul_coeff p q)). This changes how polynomial equality is established, likely to align with a broader use of AddMonoidAlgebra as the underlying representation for Polynomial.
  • CompPoly/Univariate/Raw/Proofs.lean: The diff modifies the proof of lemma coeff_foldl_add in CompPoly/Univariate/Raw/Proofs.lean. The change replaces a any_goals exact (f ih)[k]?.getD 0 block with a more targeted on_goal 3 => exact (f ih)[k]?.getD 0, refining the tactic application to only the third goal rather than any matching subgoal.
  • CompPoly/Univariate/Roots/Correctness.lean: The proof of Raw.toPoly_smul is updated by replacing the rewrite rule Polynomial.coeff_smul with AddMonoidAlgebra.coeff_smul_apply. This change aligns the proof with the internal representation of CPolynomial.Raw (as an AddMonoidAlgebra), ensuring that the lemma's proof still compiles after a change in the underlying algebraic structure.
  • CompPoly/Univariate/Roots/LasVegas/Probability/Basic.lean: The theorem trialSuccessProbability_add_failed_mass had its second proof block adjusted: the lemma ENNReal.tsum_eq_add_tsum_ite was replaced by tsum_eq_add_tsum_ite. This updates the call to use the non-namespace-qualified version of the same lemma, likely following an upstream refactor that relocated or deprecated the ENNReal-prefixed form. No new definitions, theorems, or sorry/admit were introduced.
  • CompPoly/Univariate/Roots/LasVegas/Probability/EvenTrace.lean: This change modifies the proof of tryEvenTraceSplitAttemptsWith_uniformTable_none_le_geometric by replacing ENNReal.tsum_le_tsum with the plain tsum_le_tsum (leveraging typeclass inference for ℝ≥0∞) and adding a dsimp only step before rewriting with hweight h. The adjustments improve the cleanliness of the proof, likely addressing a typeclass or simplification issue, while the theorem statement and its hypotheses remain unchanged.
  • CompPoly/Univariate/Roots/LasVegas/Probability/OddTrial.lean: Updated rootProductProbabilityInput_of_lasVegasSplitterInput to replace calls to FiniteField.X_pow_card_sub_X_ne_zero and FiniteField.X_pow_card_sub_X_natDegree_eq with Polynomial.X_pow_sub_X_ne_zero and Polynomial.natDegree_X_pow_sub_X, respectively. The new lemmas are more general, not requiring the field F to be finite, and the explicit F argument is removed from the calls. The two omega proofs that supply the exponent q are kept.
  • CompPoly/Univariate/Roots/LasVegas/Probability/Recursive.lean: The diff replaces three uses of ENNReal.tsum_le_tsum with the more general tsum_le_tsum, which is part of a broader API refactor (likely ENNReal.tsum_le_tsum has been deprecated in favor of the ENNReal-aware lemma tsum_le_tsum). The affected theorems are recursiveFallback_probability_le_binomialTail, toOuterMeasure_apply_le_one, and recursiveSplitProcessPMF_rank_le_geometric. No other changes are present.
  • CompPoly/Univariate/Roots/LasVegas/Probability/Repeated.lean: In tryOddSplitAttemptsWith_uniformTable_none_le_geometric and twice in recursiveSplitWithTables_rank_le_geometric, the lemma ENNReal.tsum_le_tsum was replaced by the unqualified tsum_le_tsum, and a dsimp only step was added after the intro in the first two occurrences. These changes adapt to a library update that makes tsum_le_tsum available without the ENNReal prefix, and they ensure the goal is simplified after rewriting.
  • CompPoly/Univariate/Roots/LasVegas/Probability/Uniform.lean: In eval_ofArray_push and eval_ofArray_pair, the proof of equality of polynomials was refactored from apply Polynomial.ext; intro i to ext i : 2, a more concise use of the ext tactic. In uniformPair_separated_probability_ge_half_of_fiber_card_le, the sum inequality step now uses tsum_le_tsum (instead of ENNReal.tsum_le_tsum) and adds a dsimp only before rewriting hu, making the proof slightly cleaner.
  • CompPoly/Univariate/Roots/Shoup/FrobeniusLinear.lean: The proof of isRepresentedLinearFactor_of_dvd_frobenius_unique_root was updated to replace two dependencies on FiniteField-specific lemmas (FiniteField.X_pow_card_sub_X_ne_zero and FiniteField.X_pow_card_sub_X_natDegree_eq) with more general polynomial lemmas (Polynomial.X_pow_sub_X_ne_zero and Polynomial.natDegree_X_pow_sub_X). The uses of these lemmas now take only the cardinality argument Fintype.one_lt_card instead of the field type and the cardinality argument. No new theorems, definitions, or sorry/admit were added.
  • CompPoly/Univariate/ToPoly/Core.lean: Removed the unnecessary Polynomial.ofFinsupp wrapper from the definition of Raw.toPoly', so that the body now directly returns the AddMonoidAlgebra produced by AddMonoidAlgebra.ofCoeff. The type signature and the overall purpose of this unused alternative toPoly definition are unchanged.
  • CompPoly/Univariate/ToPoly/Degree.lean: The proof of toPoly_smul was updated to use AddMonoidAlgebra.coeff_smul_apply instead of Polynomial.coeff_smul. The lemma's statement and its simp/grind attributes remain unchanged.
  • CompPoly/Univariate/ToPoly/Equiv.lean: The proofs of Raw.toPoly_sub and toPoly_sub were refactored to rewrite the right-hand side of the goal using sub_eq_add_neg instead of changing the goal to an explicitly equivalent equality. The statements of both lemmas remain unchanged; only the proof scripts were simplified.
  • CompPoly/Univariate/ToPoly/Impl.lean: The proof of monomial_toPoly was updated by replacing Polynomial.coeff_monomial with Polynomial.coeff_monomial_apply. This change most likely adapts to a recent Mathlib refactor, since coeff_monomial_apply is the explicit lemma that returns the coefficient directly, while coeff_monomial may now be a simp lemma with a different form.
  • lakefile.lean: (minor changes, +1/-1)
  • lean-toolchain: (minor changes, +1/-1)
  • 1 file(s) filtered as noise (lockfiles, generated, or trivial): lake-manifest.json

Last updated: 2026-11-18 14:34 UTC.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Build Timing Report

  • Commit: ff46e5c
  • Message: Merge 9c78871 into 03822f3
  • Ref: chore/bump-v4.36.0
  • Comparison baseline: 9135137 from the previous successful PR update.
  • Measured on ubuntu-latest with /usr/bin/time -p.
  • Commands: clean build rm -rf .lake/build && lake build; library build (warm) lake build; test path lake test.
Measurement Baseline (s) Current (s) Delta (s) Status
Clean build 268.62 258.69 -9.93 ok
Library build (warm) 1.88 1.52 -0.36 ok
Test path 62.63 66.61 +3.98 ok

Incremental Rebuild Signal

  • Warm library build saved 257.17s vs clean (170.19x faster).

This compares a clean project build against a follow-up lake build in the same CI job (only meaningful when clean_build was requested).

Slowest Current Build Files (clean build)

Showing 20 slowest current targets from the clean build log, with comparison against the baseline clean build log when available.

Current (s) Baseline (s) Delta (s) Path
14.00 13.00 +1.00 CompPoly/Fields/Montgomery/Native64x8Inv.lean
9.20 8.10 +1.10 CompPoly/Univariate/Raw/Proofs.lean
8.40 6.80 +1.60 CompPoly/LinearAlgebra/PolynomialMatrix/Approximant/ModularEquation/Completeness.lean
7.80 5.60 +2.20 CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean
7.20 6.20 +1.00 CompPoly/Bivariate/GuruswamiSudan/Root/Alekhnovich/Correctness.lean
7.10 8.70 -1.60 CompPoly/Fields/Binary/AdditiveNTT/Correctness.lean
6.90 5.90 +1.00 CompPoly/Univariate/Basic.lean
6.70 6.40 +0.30 CompPoly/Bivariate/ToPoly.lean
6.60 5.60 +1.00 CompPoly/Univariate/NTT/Forward.lean
6.60 5.90 +0.70 CompPoly/Fields/Montgomery/Native64x8.lean
6.50 5.00 +1.50 CompPoly/Fields/Binary/AdditiveNTT/Intermediate.lean
6.50 6.30 +0.20 CompPoly/Univariate/NTTFast/Correctness/Radix4DIF.lean
6.40 5.70 +0.70 CompPoly/Fields/Binary/Tower/Abstract/Basis.lean
6.10 5.60 +0.50 CompPoly/Fields/Binary/BF128Ghash/XPowTwoPowModCertificate.lean
5.90 4.20 +1.70 CompPoly/Data/Nat/Bitwise.lean
5.70 3.70 +2.00 CompPoly/Fields/Montgomery/Native32Field.lean
5.60 5.00 +0.60 CompPoly/Bivariate/Factor.lean
5.60 4.00 +1.60 CompPoly/Fields/Montgomery/Native64x8Field.lean
5.50 4.40 +1.10 CompPoly/Fields/Binary/Tower/Fast.lean
5.50 4.70 +0.80 CompPoly/Bivariate/GuruswamiSudan/Interpolation/WitnessDivisibilityCorrectness.lean

@alexanderlhicks
alexanderlhicks merged commit afb9b13 into main Nov 18, 2026
7 checks passed
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.

1 participant