Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR uses guarded polynomial expansion in HexReflect, so term budgets apply to collected intermediate polynomials. For example,
(x+y)^20produces 21 terms and fits the default budget, but the existing estimate rejects it by counting over a million uncollected products.Conversion uses the session's remaining term budget and literal exponent limit. It charges the final term count cumulatively, including across batch entries; cache hits are charged once. The coefficient-size check remains necessary because the shared expansion does not bound coefficient growth. Conversion proofs continue to use the existing soundness theorems and kernel evaluation of the pure polynomial computation.
Conformance tests cover the binomial power, numeric powers above the reification threshold, cumulative term exhaustion, cache accounting, and excessive coefficient growth. The new successful conversions have kernel-checked proofs. The existing core, scope, and residue conformance suites pass, including the Mathlib bridges.
This draft requires the guarded-expansion API already available in Lean's October 3 nightly. Hex's root toolchain is still rc3, so ordinary monorepo CI cannot build this change until its toolchain update. The isolated
experiments/HexReflectNightlypackage pins that nightly and matching Mathlib revision and builds the production sources and all three reflection conformance suites without a whole-monorepo toolchain upgrade. It reads the production files directly and contains no alternative implementation.