Skip to content

Commit dcf9801

Browse files
committed
fix(Condensed/Solid): resolve Yoneda-obj type coercion in surjectivity proofs
Root cause: after `rw [isIso_iff_bijective]; intro h`, h has Yoneda-obj type `(yoneda.obj M).obj (op X)` rather than morphism type `X ⟶ M`. This blocked composition `h ≫ iso.hom` and broke subsequent `rw` steps. Fixes: - `profiniteSolid_fintype_isSolid` surjectivity: bind h via transparent let hm, then use congrArg (· ≫ rest) hmid to avoid right-assoc subterm-matching issue - `finFree_isSolid` surjectivity: bind h via transparent let hh before h ≫ e.inv - Remove unused `Category.assoc` simp arguments (linter) - Fix 100-char line length violation The surj_factor sorry and sol_leftCancel axiom remain as documented.
1 parent 63d0454 commit dcf9801

1 file changed

Lines changed: 27 additions & 28 deletions

File tree

Mathlib/Condensed/Solid.lean

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -220,34 +220,34 @@ theorem profiniteSolid_fintype_isSolid (T : FintypeCat.{u}) :
220220
have key := congrArg (· ≫ (finFree_iso_solid R T).inv) h_step
221221
simp only [Category.assoc, Iso.hom_inv_id, Category.comp_id] at key
222222
exact key
223-
· -- SURJECTIVITY (proved 2026-06-13)
223+
· -- SURJECTIVITY (proved 2026-06-14, congrArg approach)
224224
intro h
225-
-- Translate h to Hom(profiniteFree X, finFree T) via finFree_iso_solid.hom
226-
-- Use let (not have) so h' is transparent and h' = h ≫ iso.hom is rfl
225+
-- h has Yoneda-obj type after intro; bind as morphism via transparent let
226+
let hm : (profiniteFree R).obj X ⟶
227+
(profiniteSolid R).obj (FintypeCat.toProfinite.obj T) := h
228+
-- h': image of hm under iso_T.hom (transparent let, so h' = hm ≫ iso_T.hom by rfl)
227229
let h' : (profiniteFree R).obj X ⟶ (finFree R).obj T :=
228-
h ≫ (finFree_iso_solid R T).hom
230+
hm ≫ (finFree_iso_solid R T).hom
229231
obtain ⟨U₀, q₀, h₀, hfact⟩ := surj_factor R T X h'
230232
refine ⟨(profiniteSolid R).map q₀ ≫ (finFree_iso_solid R U₀).hom ≫
231233
h₀ ≫ (finFree_iso_solid R T).inv, ?_⟩
232234
have hmid := sol_map_counit R U₀ X q₀
233-
-- Prove the key equation using calc to handle associativity cleanly
234-
have eq1 : (profiniteSolidification R).app X ≫ (profiniteSolid R).map q₀ ≫
235-
(finFree_iso_solid R U₀).hom ≫ h₀ ≫ (finFree_iso_solid R T).inv = h :=
236-
calc (profiniteSolidification R).app X ≫ (profiniteSolid R).map q₀ ≫
237-
(finFree_iso_solid R U₀).hom ≫ h₀ ≫ (finFree_iso_solid R T).inv
238-
= ((profiniteSolidification R).app X ≫ (profiniteSolid R).map q₀ ≫
239-
(finFree_iso_solid R U₀).hom) ≫ h₀ ≫ (finFree_iso_solid R T).inv := by
240-
simp only [Category.assoc]
241-
_ = (profiniteFree R).map q₀ ≫ h₀ ≫ (finFree_iso_solid R T).inv := by
242-
rw [hmid]
243-
_ = ((profiniteFree R).map q₀ ≫ h₀) ≫ (finFree_iso_solid R T).inv := by
244-
rw [← Category.assoc]
245-
_ = h' ≫ (finFree_iso_solid R T).inv := by
246-
rw [← hfact]
247-
_ = h := by
248-
rw [show h' = h ≫ (finFree_iso_solid R T).hom from rfl,
249-
Category.assoc, (finFree_iso_solid R T).hom_inv_id, Category.comp_id]
250-
exact eq1
235+
-- Step 1: sol ≫ solid.map q₀ ≫ iso_U₀.hom ≫ h₀ ≫ iso_T.inv
236+
-- = profiniteFree.map q₀ ≫ h₀ ≫ iso_T.inv (via congrArg + hmid)
237+
have step1 : (profiniteSolidification R).app X ≫ (profiniteSolid R).map q₀ ≫
238+
(finFree_iso_solid R U₀).hom ≫ h₀ ≫ (finFree_iso_solid R T).inv =
239+
(profiniteFree R).map q₀ ≫ h₀ ≫ (finFree_iso_solid R T).inv := by
240+
have key := congrArg (· ≫ h₀ ≫ (finFree_iso_solid R T).inv) hmid
241+
exact key
242+
-- Step 2: profiniteFree.map q₀ ≫ h₀ ≫ iso_T.inv = h
243+
-- (hfact: h' = map q₀ ≫ h₀; h' = hm ≫ iso_T.hom; hm := h; iso cancel)
244+
have step2 : (profiniteFree R).map q₀ ≫ h₀ ≫ (finFree_iso_solid R T).inv = h := by
245+
have key2 := congrArg (· ≫ (finFree_iso_solid R T).inv) hfact.symm
246+
simp only [Category.assoc] at key2
247+
-- key2: map q₀ ≫ h₀ ≫ iso_T.inv = h' ≫ iso_T.inv; expand h' to trigger hom_inv_id
248+
rw [key2, show h' = hm ≫ (finFree_iso_solid R T).hom from rfl,
249+
Category.assoc, (finFree_iso_solid R T).hom_inv_id, Category.comp_id]
250+
exact step1.trans step2
251251

252252
/-! ### Limits of solid modules are solid -/
253253

@@ -270,7 +270,6 @@ lemma isSolid_of_isLimit_gen
270270
apply hc.hom_ext; intro j; apply (bijFun j).1
271271
have hfg' : sol ≫ f = sol ≫ g := hfg
272272
have key := congrArg (· ≫ c.π.app j) hfg'
273-
simp only [Category.assoc] at key
274273
exact key
275274
· intro h_map
276275
choose g_j hg_j using fun j => (bijFun j).2 (h_map ≫ c.π.app j)
@@ -317,15 +316,15 @@ theorem finFree_isSolid (T : FintypeCat.{u}) : ((finFree R).obj T).IsSolid := by
317316
have key2 := congrArg (· ≫ e.hom) hfinv
318317
simp only [Category.assoc, e.inv_hom_id, Category.comp_id] at key2
319318
exact key2
320-
· -- SURJECTIVITY: translate via e.inv, then lift back with e.hom
319+
· -- SURJECTIVITY: h has Yoneda-obj type; let-bind as morphism first
321320
intro h
322-
obtain ⟨f', hf'⟩ := hM.2 (h ≫ e.inv)
321+
let hh : (profiniteFree R).obj X ⟶ (finFree R).obj T := h
322+
obtain ⟨f', hf'⟩ := hM.2 (hh ≫ e.inv)
323323
refine ⟨f' ≫ e.hom, ?_⟩
324-
have hf'' : (profiniteSolidification R).app X ≫ f' = h ≫ e.inv := hf'
324+
have hf'' : (profiniteSolidification R).app X ≫ f' = hh ≫ e.inv := hf'
325325
have key3 := congrArg (· ≫ e.hom) hf''
326326
simp only [Category.assoc, e.inv_hom_id, Category.comp_id] at key3
327-
-- show converts Yoneda goal to direct form so exact key3 matches
328-
show (profiniteSolidification R).app X ≫ (f' ≫ e.hom) = h
327+
change (profiniteSolidification R).app X ≫ (f' ≫ e.hom) = h
329328
exact key3
330329

331330
/-! ### General solidness of `profiniteSolid R` -/

0 commit comments

Comments
 (0)