Conversation
jjdishere
left a comment
There was a problem hiding this comment.
Review of feat(ConnectedComponents): new proofs
The PR fills 3 sorry placeholders across 2 files. The mathematical content is correct — Prespectral.of_profinite, t2Space_connectedComponent, and lift_bijective_of_isPullback all follow sound proof strategies.
Main suggestions:
- Several
haveblocks can be shortened significantly (see inline comments) lift_bijective_of_isPullbackat ~157 lines should be decomposed into helper lemmas- Check whether
open Limitsis actually needed - Commit message "AI progress" should be more descriptive
Overall the mathematics is solid — the style just needs tightening.
| SpectralSpace Y := pb.spectralSpace | ||
|
|
||
| omit [SpectralSpace X] in | ||
| theorem ConnectedComponents.lift_bijective_of_isPullback {Y T : Type u} [TopologicalSpace Y] |
There was a problem hiding this comment.
This proof is ~157 lines, well past the 100-line guideline. Consider extracting standalone helper lemmas:
hg_surj→ a lemma likeFunction.Surjective_fst_of_isPullback(surjectivity ofgfrom the pullback structure)hFib→ a lemma likeIsPreconnected_fiber_of_isPullback(preconnectedness of fibers ofg)
This would make the main proof much more readable and the helpers independently reusable.
- Shorten hxdata using `by ext z; simp` - Shorten hxU0/hyU0 using Set.mem_iInter₂ - Clean up inline `by simpa` in isClosed_and_iUnion_connectedComponent_eq_iff - Extract surjective_fst_of_isPullback and isPreconnected_fiber_of_isPullback as standalone helper lemmas from the 157-line lift_bijective_of_isPullback - Simplify φ definition and hsetY proof Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| have : x ∈ T := (hSat z hxz) hxmem | ||
| exact hxT this |
There was a problem hiding this comment.
merge these in one line
- Inline single-use term-mode `have`s (hEq, hxy, hTcomp, hVT, hyCpt) - Fix `rw [show ... from ...]` → use named `have` instead - Merge consecutive single-use term-mode `have`s where possible Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| theorem isClosed_and_iUnion_connectedComponent_eq_iff {T : Set X} : | ||
| (IsClosed T ∧ ∃ I : Set X, ⋃ x ∈ I, connectedComponent x = T) ↔ | ||
| ∃ J : Set ({U : Set X // IsClopen U}), ⋂ (U : J), U = T := by | ||
| classical |
| let J : Set ({U : Set X // IsClopen U}) := {U | T ⊆ U} | ||
| refine ⟨J, ?_⟩ | ||
| refine Set.Subset.antisymm ?_ ?_ |
There was a problem hiding this comment.
| let J : Set ({U : Set X // IsClopen U}) := {U | T ⊆ U} | |
| refine ⟨J, ?_⟩ | |
| refine Set.Subset.antisymm ?_ ?_ | |
| refine ⟨{U | T ⊆ U}, Set.Subset.antisymm ?_ ?_⟩ |
| · exact hx | ||
| · exact mem_connectedComponent | ||
| by_contra hxT | ||
| have hSat : ∀ z, z ∈ T → connectedComponent z ⊆ T := by |
There was a problem hiding this comment.
This should be separated as a lemma
| rw [(connectedComponent_eq hzw).symm] | ||
| intro u hu | ||
| simpa [hI] using (Set.mem_iUnion₂.mpr ⟨w, hwI, hu⟩ : u ∈ ⋃ x ∈ I, connectedComponent x) | ||
| have hdis : Disjoint (connectedComponent x) T := by |
There was a problem hiding this comment.
This should be separated as a lemma
| let K : Type u := {U : Set X // IsClopen U ∧ x ∈ U} | ||
| have hInter : (⋂ U : K, (U : Set X)) = connectedComponent x := |
There was a problem hiding this comment.
This could also be a lemma
| have hcover : T ⊆ ⋃ U : K, (U : Set X)ᶜ := by | ||
| intro z hz | ||
| have hznot : z ∉ connectedComponent x := by | ||
| intro hz' | ||
| exact (Set.disjoint_left.mp hdis) hz' hz | ||
| have : z ∉ ⋂ U : K, (U : Set X) := by rwa [hInter] | ||
| simp only [Set.mem_iInter, not_forall] at this | ||
| exact Set.mem_iUnion.mpr this |
There was a problem hiding this comment.
instead of using have ... exact, you should use apply without using have.
| obtain ⟨s, hs⟩ := | ||
| hT.isCompact.elim_finite_subcover | ||
| (U := fun U : K => (U : Set X)ᶜ) | ||
| (fun U => U.2.1.1.isOpen_compl) hcover |
There was a problem hiding this comment.
these does not need to take 4 lines
| · have : IsClosed (⋂ U : J, (U : Set X)) := isClosed_iInter fun U => (U.1.2).1 | ||
| simpa [hJ] using this |
There was a problem hiding this comment.
have a term proof, merge into one line
| · refine ⟨T, ?_⟩ | ||
| refine Set.Subset.antisymm ?_ ?_ | ||
| · intro z hz |
There was a problem hiding this comment.
refine ⟨T, Set.Subset.antisymm (fun z hz \maspto ?) (fun z hz \maspto ?)⟩
- Extract connectedComponent_subset_of_iUnion_eq and disjoint_connectedComponent_of_not_mem as standalone lemmas - Inline let J, merge consecutive refine calls - Remove unnecessary classical - Shorten hVcl, use apply instead of have...exact - Merge refine ⟨T, ?_⟩ + refine Set.Subset.antisymm into one refine - Inline hzInter as term-mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jjdishere
left a comment
There was a problem hiding this comment.
Second review pass (full style checklist)
Going through every item in the style/naming/quality checklist.
Issues found
1. by alone on its own line (L215-216)
[PrespectralSpace X] : T2Space (ConnectedComponents X) :=
by
Should be ... := by on one line.
2. Double space (L214)
instance t2Space_connectedComponent {X : Type u} [TopologicalSpace X] [CompactSpace X]
Extra space before [CompactSpace X].
3. Lines exceeding 100 characters
- L148 (101 chars):
simpa [hI] using (Set.mem_iUnion₂.mpr ⟨w, hwI, hu⟩ : ...) - L231 (103 chars): comment
-- Use compactness of ... - L422 (161 chars):
(isHomeomorph_iff_continuous_bijective ...).mpr ⟨...⟩
4. show ... by ... inside simp (L398)
simp [fiberP, this, show (p : T × X).fst = t by simpa [FSt] using hp]
This is effectively the banned show ... from pattern. Extract as a named have.
Items that pass
- No
λ, no semicolons, nochange, noopen Classical, noshow ... frominrw - No
haveI, no unusedletbindings, no unnecessary type annotations - Naming conventions followed (
snake_casefor propositions,UpperCamelCasefor types) - Docstrings present on new helper lemmas
- No
sorry, noaxiom, noset_option maxHeartbeats - Helper lemmas use weakest hypotheses (with
omitfor section vars) - No duplicate declarations
No description provided.