Skip to content

Commit b08d71d

Browse files
committed
chore(CategoryTheory/Sites): golf some proofs in the coherent topology file (#9979)
1 parent 750e6f2 commit b08d71d

File tree

1 file changed

+21
-40
lines changed

1 file changed

+21
-40
lines changed

Mathlib/CategoryTheory/Sites/Coherent/CoherentTopology.lean

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,24 @@ namespace CategoryTheory
2121

2222
variable {C : Type*} [Category C] [Precoherent C] {X : C}
2323

24-
namespace coherentTopology
25-
2624
/--
2725
For a precoherent category, any sieve that contains an `EffectiveEpiFamily` is a sieve of the
2826
coherent topology.
2927
Note: This is one direction of `mem_sieves_iff_hasEffectiveEpiFamily`, but is needed for the proof.
3028
-/
31-
theorem mem_sieves_of_hasEffectiveEpiFamily (S : Sieve X) :
29+
theorem coherentTopology.mem_sieves_of_hasEffectiveEpiFamily (S : Sieve X) :
3230
(∃ (α : Type) (_ : Fintype α) (Y : α → C) (π : (a : α) → (Y a ⟶ X)),
33-
EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) →
34-
(S ∈ GrothendieckTopology.sieves (coherentTopology C) X) := by
35-
rintro ⟨α, ⟨h, ⟨Y, ⟨π, hπ⟩⟩⟩⟩
36-
have h_le : Sieve.generate (Presieve.ofArrows _ π) ≤ S := by
37-
rw [Sieve.sets_iff_generate (Presieve.ofArrows _ π) S]
38-
apply Presieve.le_of_factorsThru_sieve (Presieve.ofArrows (fun i => Y i) π) S _
39-
intro W g f
40-
use W, 𝟙 W
41-
rcases f with ⟨i⟩
42-
exact ⟨π i, ⟨hπ.2 i,Category.id_comp (π i) ⟩⟩
43-
apply Coverage.saturate_of_superset (coherentCoverage C) h_le
44-
exact Coverage.saturate.of X _ ⟨α, inferInstance, Y, π, ⟨rfl, hπ.1⟩⟩
45-
46-
end coherentTopology
31+
EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) →
32+
(S ∈ GrothendieckTopology.sieves (coherentTopology C) X) := by
33+
intro ⟨α, _, Y, π, hπ⟩
34+
refine Coverage.saturate_of_superset (coherentCoverage C) ?_
35+
(Coverage.saturate.of X _ ⟨α, inferInstance, Y, π, rfl, hπ.1⟩)
36+
rw [Sieve.sets_iff_generate]
37+
apply Presieve.le_of_factorsThru_sieve (Presieve.ofArrows (fun i => Y i) π) S _
38+
intro W g f
39+
refine ⟨W, 𝟙 W, ?_⟩
40+
rcases f with ⟨i⟩
41+
exact ⟨π i, hπ.2 i, by simp⟩
4742

4843
/--
4944
Effective epi families in a precoherent category are transitive, in the sense that an
@@ -63,12 +58,6 @@ theorem EffectiveEpiFamily.transitive_of_finite {α : Type} [Fintype α] {Y : α
6358
change Nonempty _
6459
rw [← Sieve.forallYonedaIsSheaf_iff_colimit]
6560
exact fun W => coherentTopology.isSheaf_yoneda_obj W _ h₂
66-
let h' := h
67-
rw [← Sieve.effectiveEpimorphic_family] at h'
68-
let H' := H
69-
conv at H' =>
70-
intro a
71-
rw [← Sieve.effectiveEpimorphic_family]
7261
-- Show that a covering sieve is a colimit, which implies the original set of arrows is regular
7362
-- epimorphic. We use the transitivity property of saturation
7463
apply Coverage.saturate.transitive X (Sieve.generate (Presieve.ofArrows Y π))
@@ -80,10 +69,8 @@ theorem EffectiveEpiFamily.transitive_of_finite {α : Type} [Fintype α] {Y : α
8069
apply coherentTopology.mem_sieves_of_hasEffectiveEpiFamily
8170
-- Need to show that the pullback of the family `π_n` to a given `Y i` is effective epimorphic
8271
rcases hY with ⟨i⟩
83-
use β i, inferInstance, Y_n i, π_n i, H i
84-
intro b
85-
use Y_n i b, (𝟙 _), π_n i b ≫ π i, ⟨(⟨i, b⟩ : Σ (i : α), β i)⟩
86-
exact Category.id_comp (π_n i b ≫ π i)
72+
exact ⟨β i, inferInstance, Y_n i, π_n i, H i, fun b ↦
73+
⟨Y_n i b, (𝟙 _), π_n i b ≫ π i, ⟨(⟨i, b⟩ : Σ (i : α), β i)⟩, by simp⟩⟩
8774

8875
/--
8976
A sieve belongs to the coherent topology if and only if it contains a finite
@@ -96,22 +83,16 @@ theorem coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (S : Sieve X) :
9683
constructor
9784
· intro h
9885
induction' h with Y T hS Y Y R S _ _ a b
99-
· rcases hS with ⟨a, h, Y', π, h'⟩
100-
use a, h, Y', π, by tauto
101-
intro a'
86+
· rcases hS with ⟨a, h, Y', π, h', _⟩
87+
refine ⟨a, h, Y', π, inferInstance, fun a' ↦ ?_⟩
10288
rcases h' with ⟨rfl, _⟩
103-
simp only [Sieve.generate_apply]
104-
use Y' a', 𝟙 Y' a', π a', Presieve.ofArrows.mk a'
105-
apply Category.id_comp
106-
· use Unit, Unit.fintype, fun _ => Y, fun _ => (𝟙 Y)
107-
cases' S with arrows downward_closed
108-
exact ⟨inferInstance, by simp only [Sieve.top_apply, forall_const]⟩
89+
exact ⟨Y' a', 𝟙 Y' a', π a', Presieve.ofArrows.mk a', by simp⟩
90+
· exact ⟨Unit, Unit.fintype, fun _ => Y, fun _ => (𝟙 Y), inferInstance, by simp⟩
10991
· rcases a with ⟨α, w, Y₁, π, ⟨h₁,h₂⟩⟩
11092
choose β _ Y_n π_n H using fun a => b (h₂ a)
111-
use (Σ a, β a), inferInstance, fun ⟨a,b⟩ => Y_n a b, fun ⟨a, b⟩ => (π_n a b) ≫ (π a)
112-
constructor
113-
· exact EffectiveEpiFamily.transitive_of_finite _ h₁ _ (fun a => (H a).1)
114-
· exact fun c => (H c.fst).2 c.snd
93+
exact ⟨(Σ a, β a), inferInstance, fun ⟨a,b⟩ => Y_n a b, fun ⟨a, b⟩ => (π_n a b) ≫ (π a),
94+
EffectiveEpiFamily.transitive_of_finite _ h₁ _ (fun a => (H a).1),
95+
fun c => (H c.fst).2 c.snd⟩
11596
· exact coherentTopology.mem_sieves_of_hasEffectiveEpiFamily S
11697

11798
end CategoryTheory

0 commit comments

Comments
 (0)