feat: calculate the nonlinear parameter projection - #5070
Conversation
Co-Authored-By: Codex <noreply@github.com>
There was a problem hiding this comment.
🟡 reuse — request_changes claude/claude-opus-5
No existing declaration is duplicated wholesale; the linear parameterProj API is properly reused. But the file contains a private lemma that restates a public one, and two proofs that re-derive results already provided by Mathlib and by an earlier line of the same file.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:93— The privatelevelSetParameterMap_eqis exactly thefunextof the publiclevelSetParameterMap_apply(line 80); the two state the same fact pointwise and as functions. Fix: DeletelevelSetParameterMap_eqand replace its two uses (lines 124, 146) withrw [funext (levelSetParameterMap_apply hf hD hker hxl)]— the same idiom already used atTauCeti/Analysis/Fredholm/SardSmale.lean:173(rw [funext (pkg.obstructionSlice_apply hT y.1)]).TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:138—hcomp := (ContinuousLinearMap.snd K E Λ).hasStrictFDerivAt.comp 0 hchartre-derives Mathlib'sHasStrictFDerivAt.snd, which already givesHasStrictFDerivAt (fun x => (f x).2) ((snd 𝕜 F G).comp f') x— the exact statement, with the exact composite maphlinearthen rewrites. Fix: Usehave hcomp := hchart.snd, matching thehchart.sndalready used at line 125 for theContDiffAtversion.TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:239—hFredis reproved byrw [hg']; exact isFredholm_parameterProj D₁ D₂ hD₁, duplicatingisFredholm_fderiv_levelSetParameterMapproved 50 lines earlier (line 189), which has no other consumer in the repo. Fix: Replace lines 239-241 withhave hFred := isFredholm_fderiv_levelSetParameterMap hf hD hker hxl hD₁; it applies over ℝ sinceRCLike ℝgivesIsRCLikeNormedField ℝ(mathlib/Mathlib/Analysis/RCLike/Basic.lean:1298) andCompleteSpace ℝholds.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5 · 136s · 2.3k in / 9.9k out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
🟡 api-design — request_changes claude/claude-opus-5
The exported surface is minimal and bodies stay hidden, but the headline Sard--Smale theorem is stated with let-bound hypotheses instead of taking hker like every other declaration in the file, the main derivative computation lacks @[simp], and the file characterizes fderiv g only at 0, so consumers cannot read the exported critical-value set as a statement about parameters of the equation.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:224—exists_mem_nhds_isClosed_isNowhereDense_image_criticalPoints_levelSetParameterMapputslet hker := hD₁.closedComplemented_ker_coprod hDandlet g := ...inside the statement, forcing zeta reduction on every use and pinninghkerto one particular proof term. Every other declaration here (lines 71, 80, 106, 115, 129, 151, 161, 173, 189) takeshker : (D₁.coprod D₂).ker.ClosedComplementedas an argument. Fix: Add(hker : (D₁.coprod D₂).ker.ClosedComplemented)as an explicit hypothesis and spell the conclusion out in terms oflevelSetParameterMap hf hD hker hxl, dropping bothlets (and the openingdsimp only).TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:151—fderiv_levelSetParameterMapis the file's normal-form computation lemma (fderiv K (levelSetParameterMap hf hD hker hxl) 0 = parameterProj D₁ D₂) and carries no@[simp]; all its hypotheses occur as arguments of the LHS, so it is an unconditional, non-looping rewrite. Without itsimpcannot compute this derivative. Fix: Markfderiv_levelSetParameterMap@[simp](leaving the derivedsurjective_fderiv_..._iffandindex_fderiv_...unannotated, since their LHSs would then not be in simp normal form).TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:216— The exported conclusion quantifies over{k | ¬ Surjective (fderiv ℝ g k)}for allkin a neighbourhood, but the only characterization offderiv gthe file supplies is atk = 0(surjective_fderiv_levelSetParameterMap_iff). A consumer therefore cannot convertg '' (N ∩ crit)into a set of singular parameters of the equation, though the name and the "Local parametric Sard--Smale" docstring invite that reading. Fix: Either supply the nearby-point version ofsurjective_fderiv_levelSetParameterMap_iff(under a hypothesis giving the total linearization at points of the level set near(x, l)), or state in the docstring and in the module header that the criticality criterion is available only at the chart origin, so the conclusion is not yet a statement about regular parameters.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5 · 241s · 2.3k in / 18.2k out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
🟡 naming — request_changes claude/claude-opus-5
Names track the existing levelSetChart/parameterProj precedents and no notation is introduced; one lemma puts surjective as a prefix against the convention and against the adjacent lemma it is derived from.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:161—surjective_fderiv_levelSetParameterMap_iffprefixes the predicate; the naming doc lists_surjectiveunder "Predicates as suffixes", and the lemma it is proved from isparameterProj_surjective_iff(Parametric.lean:376). It also breaks the file's own…_fderiv_levelSetParameterMapblock (index_fderiv_…line 173,isFredholm_fderiv_…line 189). Fix: Rename tofderiv_levelSetParameterMap_surjective_iff.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5 · 129s · 2.3k in / 9.9k out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
🟡 proof-quality — request_changes claude/claude-opus-5
Proofs are short and mostly fine, but one step closes a wrapper/coercion identity by bare rfl without documentation, the final theorem re-proves a lemma stated 40 lines above, and a private lemma duplicates a public one.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:144—hlinearis closed byext k; rw [parameterProj_apply]; rfl, where the trailingrflsilently unfoldsContinuousLinearMap.comp,Submodule.subtypeLandContinuousLinearMap.sndcoercions. The fact is definitional (parameterProj = snd.domRestrict keranddomRestrict f p = f ∘SL p.subtypeL), so this reusable identity is hidden inside a proof. Fix: Add a named lemma next toparameterProjinTauCeti/Analysis/Fredholm/Parametric.lean, e.g.theorem parameterProj_eq_comp_subtypeL : parameterProj D₁ D₂ = (ContinuousLinearMap.snd 𝕜 E Λ).comp (D₁.coprod D₂).ker.subtypeL := rfl, andrw [← parameterProj_eq_comp_subtypeL]here.TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:239—hFredre-provesisFredholm_fderiv_levelSetParameterMap(line 189) inline viarw [hg']; exact isFredholm_parameterProj D₁ D₂ hD₁, duplicating the reasoning the file already exports. Fix:have hFred := isFredholm_fderiv_levelSetParameterMap hf hD hker hxl hD₁—ℝsatisfiesIsRCLikeNormedFieldandCompleteSpace, so the RCLike-section lemma applies verbatim.TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:229— The statement'slet hker/let gare stripped by a bare, undocumenteddsimp onlyand then re-created as freshlets in the proof; the finalexactthen matches the goal only up to zeta-reduction, which is the same opacity as an undocumentedshow. Fix: Replacedsimp only+ the two re-declaredlets withintro hker g, which introduces the statement's own let-bindings and keeps the goal syntactically in terms of them.TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:93—levelSetParameterMap_eq(private) is the funext form of the publiclevelSetParameterMap_apply; both arerflfacts about the same definition, so the same statement exists twice.levelSetParameterMap_apply's proofunfold levelSetParameterMap; rflalso has a redundantunfold. Fix: DeletelevelSetParameterMap_eqand rewrite withfunext fun k ↦ levelSetParameterMap_apply ..at the two use sites (lines 124, 146), or keep only the funext form; provelevelSetParameterMap_applybyrfl.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5 · 178s · 2.3k in / 14.1k out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
One proof-style sub-suggestion was not applicable: changing levelSetParameterMap_apply to bare rfl fails Lean with Not a definitional equality and the exported-theorem note that required definitions are not exposed. I therefore retained the necessary unfold levelSetParameterMap; rfl. The substantive issue is fixed at d50eca5: the duplicate private function-equality lemma is deleted and both consumers use funext of the public apply lemma; the wrapper identity is now a documented public lemma proved through the exposed simp API.
There was a problem hiding this comment.
Re: your reply on proof-quality — re-reviewed on d50eca5; this clears the finding ✅ — approved on d50eca5.
codex/gpt-5.6-sol · addresses your replies through comment 3890818196.
There was a problem hiding this comment.
Re: your reply on proof-quality — re-reviewed on 910f28e; this clears the finding ✅ — approved on 910f28e.
codex/gpt-5.6-sol · addresses your replies through comment 3890818196.
There was a problem hiding this comment.
Re: your reply on proof-quality — re-reviewed on e0e1b46; this clears the finding ✅ — approved on e0e1b46.
codex/gpt-5.6-sol · addresses your replies through comment 3890818196.
AI review — changes requestedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Apply the review findings for reuse, API shape, naming, and proof quality while documenting the local criticality limitation. Co-Authored-By: Codex <noreply@github.com>
There was a problem hiding this comment.
🟡 generality — request_changes codex/gpt-5.6-sol
The two Fredholm-specialized APIs require a complemented-kernel witness already implied by their other hypotheses.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:175—isFredholm_fderiv_levelSetParameterMapand the theorem at line 206 both exposehker, althoughhD₁andhDcanonically supply it. Fix: Removehkerfrom these specialized signatures and construct the chart/map usinghD₁.closedComplemented_ker_coprod hD; retainhkeronly in the generic chart-level results where it is not derivable.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
codex/gpt-5.6-sol · 28s · 80.6k in / 1.1k out tokens · reviewing this diff · rubric
AI review — changes requestedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Remove redundant complemented-kernel parameters from the Fredholm-specialized APIs and use the canonical witness supplied by Fredholmness and total surjectivity. Co-Authored-By: Codex <noreply@github.com>
There was a problem hiding this comment.
🟡 api-design — request_changes codex/gpt-5.6-sol
The application lemma is now correctly tagged, but the canonical value at the chart origin still lacks its normal-form annotation.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:91—levelSetParameterMap_zerois the canonical reduction rule at the chart origin but is not marked@[simp]. Fix: Add@[simp]tolevelSetParameterMap_zero.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
codex/gpt-5.6-sol · 30s · 43.4k in / 666 out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
I contest this finding: marking levelSetParameterMap_zero @[simp] is not a legal simp lemma here, and CI's environment-linter gate rejects it.
levelSetParameterMap_apply is @[simp] — that annotation was added in 9750c07 precisely because the round-1 api-design finding asked for the characteristic reduction rule of the opaque definition to be the simp normal form. levelSetChart_symm_zero (TauCeti/Analysis/Fredholm/LevelSet/Basic.lean:252) is also @[simp]. Together they already close the statement of levelSetParameterMap_zero, so adding @[simp] to it makes it non-simp-normal.
Empirically, with @[simp] added to levelSetParameterMap_zero and nothing else changed, #lint only simpNF in TauCeti (the check CI runs via scripts/lint-env.sh) fails:
-- Found 1 error in 224 declarations (plus 102 automatically generated ones) in TauCeti with 1 linters
/- The `simpNF` linter reports:
SOME SIMP LEMMAS ARE NOT IN SIMP-NORMAL FORM. -/
-- TauCeti.Analysis.Fredholm.LevelSet.Parametric
#check @TauCeti.levelSetParameterMap_zero /- simp can prove this:
by simp only [*, @TauCeti.levelSetParameterMap_apply, @Set.mem_ofPred_eq,
@TauCeti.levelSetChart_symm_zero]
One of the lemmas above could be a duplicate. -/
Reverting that one attribute (i.e. the tree as it stands at e0e1b46) gives -- All linting checks passed! on the same probe. scripts/lint-baseline.txt has no grandfathered entry for this declaration, and silencing the linter with @[nolint simpNF] is not permitted by the repo rules.
This is exactly why e0e1b46b removed the attribute: the two requests cannot both hold. levelSetParameterMap_zero is kept as a named, documented convenience theorem, and simp still computes the value at the origin unaided through the two existing simp lemmas — so nothing is lost for consumers. I have therefore left the tree unchanged.
There was a problem hiding this comment.
Re: your reply on api-design — re-reviewed on e0e1b46; the finding stands — The public API is nearly complete, but its canonical origin-value theorem is missing the expected simplifier annotation.
codex/gpt-5.6-sol · addresses your replies through comment 3902955650.
AI review — changes requestedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Mark the characteristic reduction theorem as a simp lemma for downstream normalization. Co-Authored-By: Codex <noreply@github.com>
Keep the named origin-value theorem while relying on the existing general application and chart-origin simp lemmas for normalization. Co-Authored-By: Codex <noreply@github.com>
There was a problem hiding this comment.
🟡 reuse — request_changes codex/gpt-5.6-sol
One public theorem redundantly packages a result already discharged by the simp API.
TauCeti/Analysis/Fredholm/LevelSet/Parametric.lean:96—levelSetParameterMap_zerois a composite duplicate:levelSetParameterMap_applyandlevelSetChart_symm_zeroare both[simp], soby simpalready proves its statement. Fix: DeletelevelSetParameterMap_zeroand usesimpat any future call site.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
codex/gpt-5.6-sol · 87s · 205.2k in / 2.6k out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
Fixed in 5bdacfb9. parameterProj_eq_comp_subtypeL is gone and TauCeti/Analysis/Fredholm/Parametric.lean is back to its state on main, so the PR now touches only the new module.
The derivative calculation needs the composition form, so per the suggested fix the identity is now a local have inside hasStrictFDerivAt_levelSetParameterMap, proved by ext v; simp through the existing parameterProj_apply simp lemma. That keeps the round-1 proof-quality finding (comment 3884503542) addressed — the wrapper/coercion step is still not a bare undocumented rfl — without exporting a public restatement of the definition.
Verified on 5bdacfb9: lake build → Build completed successfully (9833 jobs).; lake exe axioms → audited 86819 TauCeti declaration(s); all within the allowlist [propext, Classical.choice, Quot.sound].
There was a problem hiding this comment.
Re: your reply on reuse — re-reviewed on 5bdacfb; the finding stands — One public theorem redundantly packages a result already discharged by the simp API.
codex/gpt-5.6-sol · addresses your replies through comment 3905892550.
There was a problem hiding this comment.
✅ api-design — now passing on 5bdacfb.
There was a problem hiding this comment.
I contest this finding again, with a fresh reproduction on the current tree: @[simp] on levelSetParameterMap_zero makes the repo's environment-linter gate (scripts/lint-env.sh, which runs #lint only … in TauCeti) fail, so complying would push CI red.
levelSetParameterMap_apply is @[simp] (added in 9750c07 at an earlier api-design request that the round-2 root acknowledged as "the application lemma is now correctly tagged"), and levelSetChart_symm_zero is @[simp] in TauCeti/Analysis/Fredholm/LevelSet/Basic.lean. Those two already close levelSetParameterMap_zero, so tagging it too puts it out of simp-normal form.
Reproduced just now on 5bdacfb9, adding only the one attribute and nothing else, then lake build TauCeti.Analysis.Fredholm.LevelSet.Parametric and lake env lean on a driver containing import TauCeti.Analysis.Fredholm.LevelSet.Parametric + #lint only simpNF in TauCeti:
error: -- Found 1 error in 223 declarations (plus 102 automatically generated ones) in TauCeti with 1 linters
/- The `simpNF` linter reports:
SOME SIMP LEMMAS ARE NOT IN SIMP-NORMAL FORM. -/
-- TauCeti.Analysis.Fredholm.LevelSet.Parametric
#check @TauCeti.levelSetParameterMap_zero /- simp can prove this:
by simp only [*, @TauCeti.levelSetParameterMap_apply, @Set.mem_ofPred_eq,
@TauCeti.levelSetChart_symm_zero]
One of the lemmas above could be a duplicate. -/
Without that attribute — i.e. the tree exactly as pushed — the identical probe reports:
-- Found 0 errors in 223 declarations (plus 102 automatically generated ones) in TauCeti with 1 linters
-- All linting checks passed!
There is no legitimate way to keep the attribute: scripts/lint-baseline.txt and scripts/lint-nolints-allowlist.txt are human-owned (the script's own header calls the allowlist "exactly the hole an auto-merged PR would otherwise use"), and the repo rules forbid silencing a linter. The only alternative that would let levelSetParameterMap_zero carry @[simp] is to strip @[simp] from levelSetParameterMap_apply, which reverses the earlier api-design request this same rubric approved.
Nothing is lost for consumers: simp still reduces levelSetParameterMap hf hD hker hxl 0 to l unaided, via the two existing simp lemmas — which is precisely why the linter rejects the third one. levelSetParameterMap_zero remains as a named, documented theorem for explicit rw/exact use.
This round's push (5bdacfb9) addresses the reuse finding on parameterProj_eq_comp_subtypeL and leaves the simp set unchanged. Verified on 5bdacfb9: lake build → Build completed successfully (9833 jobs).; lake exe axioms → audited 86819 TauCeti declaration(s); all within the allowlist [propext, Classical.choice, Quot.sound].
There was a problem hiding this comment.
Re: your reply on api-design — re-reviewed on 5bdacfb; this clears the finding ✅ — approved on 5bdacfb.
codex/gpt-5.6-sol · addresses your replies through comment 3905891010.
AI review — changes requestedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Drop the public `parameterProj_eq_comp_subtypeL`, which only restated `ContinuousLinearMap.domRestrict` as a composition with the kernel inclusion, and prove the identity locally where the derivative calculation needs it, through the existing `parameterProj_apply` simp lemma. Co-Authored-By: Claude Code <noreply@github.com>
This PR computes the nonlinear parameter projection in a regular chart of a universal Fredholm level set. It defines
levelSetParameterMap, proves that its derivative at the chart origin is exactly the existing linear mapparameterProj D₁ D₂, and derives the expected surjectivity, Fredholm, and index statements. It then applies the local Sard--Smale theorem to show that critical values coming from a sufficiently small chart neighbourhood form a closed nowhere dense set.The exact roadmap target is
TauCetiRoadmap/HeegaardFloer/README.md, Lane F0, milestone “the moduli space = zero set of a Fredholm section, generically a manifold of dimension = index” package. This is the most effective current step becauseparameterProj, the complemented-kernel theorem for universal linearizations, smooth regular-level-set charts, and Sard--Smale are all onmain, while the only open HeegaardFloer PR (#5018) develops the independent split-quadratic Morse-flow model in Lane M. After this PR, the Lane F0 milestone still needs smooth compatibility and a countable localization across universal-level-set charts to obtain a residual set of regular parameters globally; the separate strip-operator targetd/ds + A(s)also remains.The new module
TauCeti/Analysis/Fredholm/LevelSet/Parametric.leanis 252 lines. Its public API keeps the level-set chart construction generic over a nontrivially normed field, specializes Fredholmness only to the existing RCLike setting, and specializes Sard--Smale only to real Banach spaces. No Mathlib code or external formalization is vendored. The construction follows McDuff--Salamon, J-holomorphic Curves and Symplectic Topology, 2nd ed., Appendix A.3, and Smale, An infinite dimensional version of Sard's theorem (1965), as credited in the module documentation.Roadmap: HeegaardFloer
🤖 Prepared with Codex