Skip to content

Commit 6d65385

Browse files
committed
chore(CategoryTheory/Sites): generalize Precoverage.toGrothendieck_le_iff_le_toPrecoverage (leanprover-community#35920)
1 parent 89898ca commit 6d65385

2 files changed

Lines changed: 80 additions & 42 deletions

File tree

Mathlib/CategoryTheory/Sites/Coverage.lean

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -400,38 +400,6 @@ lemma Precoverage.toGrothendieck_toCoverage {J : Precoverage C} [J.HasPullbacks]
400400
| pullback _ _ _ _ _ ih => exact J.toCoverage.toGrothendieck.pullback_stable _ ih
401401
| transitive _ _ _ _ _ ih1 ih2 => exact J.toCoverage.toGrothendieck.transitive ih1 _ ih2
402402

403-
namespace GrothendieckTopology
404-
405-
/-- The induced coverage by a Grothendieck topology as a precoverage. -/
406-
def toPrecoverage (J : GrothendieckTopology C) : Precoverage C :=
407-
J.toCoverage.toPrecoverage
408-
409-
lemma mem_toPrecoverage_iff (J : GrothendieckTopology C) {S : C} (R : Presieve S) :
410-
R ∈ toPrecoverage J S ↔ Sieve.generate R ∈ J S := .rfl
411-
412-
instance (J : GrothendieckTopology C) : (toPrecoverage J).HasIsos where
413-
mem_coverings_of_isIso f hf := by simp [mem_toPrecoverage_iff]
414-
415-
instance (J : GrothendieckTopology C) : (toPrecoverage J).IsStableUnderComposition where
416-
comp_mem_coverings {ι} S X f hf σ Y g hg := by
417-
rw [mem_toPrecoverage_iff, ← Presieve.bindOfArrows_ofArrows]
418-
exact J.bindOfArrows hf hg
419-
420-
instance (J : GrothendieckTopology C) : (toPrecoverage J).IsStableUnderBaseChange where
421-
mem_coverings_of_isPullback {ι} S X f hf Y g P p₁ p₂ h := by
422-
rw [mem_toPrecoverage_iff, ← Sieve.ofArrows, Sieve.ofArrows_eq_pullback_of_isPullback _ h]
423-
exact J.pullback_stable _ hf
424-
425-
end GrothendieckTopology
426-
427-
/-- `toGrothendieck` and `toPrecoverage` form a Galois connection on the domains where they are
428-
defined. -/
429-
lemma Precoverage.toGrothendieck_le_iff_le_toPrecoverage {K : Precoverage C}
430-
{J : GrothendieckTopology C} [K.HasPullbacks] [K.IsStableUnderBaseChange] :
431-
K.toGrothendieck ≤ J ↔ K ≤ J.toPrecoverage := by
432-
rw [← toGrothendieck_toCoverage]
433-
exact (Coverage.gi C).gc _ _
434-
435403
lemma Coverage.toGrothendieck_toPrecoverage (J : Coverage C) :
436404
J.toPrecoverage.toGrothendieck = J.toGrothendieck := by
437405
rw [Coverage.toGrothendieck, GrothendieckTopology.copy_eq]

Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ lemma generate_mem_toGrothendieck {X : C} {R : Presieve X} (hR : R ∈ J X) :
7272
Sieve.generate R ∈ J.toGrothendieck X :=
7373
.of _ _ hR
7474

75-
@[gcongr]
76-
lemma toGrothendieck_mono {J K : Precoverage C} (h : J ≤ K) :
77-
J.toGrothendieck ≤ K.toGrothendieck := by
78-
intro X S hS
79-
induction hS with
80-
| of X S hS => exact generate_mem_toGrothendieck (h _ hS)
81-
| top X => simp
82-
| pullback X S _ Y f _ => grind
83-
| transitive X S R _ _ _ _ => grind
84-
8575
set_option backward.isDefEq.respectTransparency false in
8676
/--
8777
An alternative characterization of the Grothendieck topology associated to a precoverage `J`:
@@ -271,4 +261,84 @@ lemma Presieve.IsSheafFor.comp_iff_of_preservesPairwisePullbacks (F : C ⥤ D) (
271261
infer_instance
272262
exact this.1.eq_iff
273263

264+
namespace GrothendieckTopology
265+
266+
/-- The induced coverage by a Grothendieck topology as a precoverage. -/
267+
def toPrecoverage (J : GrothendieckTopology C) : Precoverage C where
268+
coverings S := { R | Sieve.generate R ∈ J S }
269+
270+
lemma mem_toPrecoverage_iff (J : GrothendieckTopology C) {S : C} (R : Presieve S) :
271+
R ∈ toPrecoverage J S ↔ Sieve.generate R ∈ J S := .rfl
272+
273+
lemma arrows_mem_toPrecoverage_iff (J : GrothendieckTopology C) {S : C} (R : Sieve S) :
274+
R.arrows ∈ toPrecoverage J S ↔ R ∈ J S := by
275+
rw [mem_toPrecoverage_iff, Sieve.generate_sieve]
276+
277+
instance (J : GrothendieckTopology C) : (toPrecoverage J).HasIsos where
278+
mem_coverings_of_isIso f hf := by simp [mem_toPrecoverage_iff]
279+
280+
instance (J : GrothendieckTopology C) : (toPrecoverage J).IsStableUnderComposition where
281+
comp_mem_coverings {ι} S X f hf σ Y g hg := by
282+
rw [mem_toPrecoverage_iff, ← Presieve.bindOfArrows_ofArrows]
283+
exact J.bindOfArrows hf hg
284+
285+
instance (J : GrothendieckTopology C) : (toPrecoverage J).IsStableUnderBaseChange where
286+
mem_coverings_of_isPullback {ι} S X f hf Y g P p₁ p₂ h := by
287+
rw [mem_toPrecoverage_iff, ← Sieve.ofArrows, Sieve.ofArrows_eq_pullback_of_isPullback _ h]
288+
exact J.pullback_stable _ hf
289+
290+
end GrothendieckTopology
291+
292+
namespace Precoverage
293+
294+
variable {K : Precoverage C} {J : GrothendieckTopology C}
295+
296+
/-- `toGrothendieck` and `toPrecoverage` form a Galois connection. -/
297+
lemma toGrothendieck_le_iff_le_toPrecoverage : K.toGrothendieck ≤ J ↔ K ≤ J.toPrecoverage := by
298+
refine ⟨fun h X R hR ↦ ?_, fun h ↦ ?_⟩
299+
· rw [GrothendieckTopology.mem_toPrecoverage_iff]
300+
exact h _ (generate_mem_toGrothendieck hR)
301+
· intro X R hR
302+
induction hR with
303+
| of X S hS => exact h _ hS
304+
| top X => grind
305+
| pullback X S _ Y f _ => grind
306+
| transitive X S R _ _ _ _ => grind
307+
308+
variable (C) in
309+
lemma galoisConnection_toGrothendieck_toPrecoverage :
310+
GaloisConnection (toGrothendieck (C := C)) GrothendieckTopology.toPrecoverage :=
311+
fun _ _ ↦ toGrothendieck_le_iff_le_toPrecoverage
312+
313+
end Precoverage
314+
315+
set_option backward.isDefEq.respectTransparency false in
316+
@[simp, grind =]
317+
lemma Precoverage.toGrothendieck_bot : toGrothendieck (⊥ : Precoverage C) = ⊥ :=
318+
(galoisConnection_toGrothendieck_toPrecoverage C).l_bot
319+
320+
set_option backward.isDefEq.respectTransparency false in
321+
@[simp, grind =]
322+
lemma GrothendieckTopology.toPrecoverage_top : toPrecoverage (⊤ : GrothendieckTopology C) = ⊤ :=
323+
(Precoverage.galoisConnection_toGrothendieck_toPrecoverage C).u_top
324+
325+
lemma Precoverage.toGrothendieck_monotone : Monotone (toGrothendieck (C := C)) :=
326+
(galoisConnection_toGrothendieck_toPrecoverage C).monotone_l
327+
328+
@[gcongr]
329+
lemma Precoverage.toGrothendieck_mono {J K : Precoverage C} (h : J ≤ K) :
330+
J.toGrothendieck ≤ K.toGrothendieck :=
331+
toGrothendieck_monotone h
332+
333+
lemma GrothendieckTopology.toPrecoverage_monotone : Monotone (toPrecoverage (C := C)) :=
334+
(Precoverage.galoisConnection_toGrothendieck_toPrecoverage C).monotone_u
335+
336+
lemma Precoverage.le_toPrecoverage_toGrothendieck (J : Precoverage C) :
337+
J ≤ J.toGrothendieck.toPrecoverage :=
338+
(galoisConnection_toGrothendieck_toPrecoverage C).le_u_l _
339+
340+
lemma GrothendieckTopology.toGrothendieck_toPrecoverage_le (J : GrothendieckTopology C) :
341+
J.toPrecoverage.toGrothendieck ≤ J :=
342+
(Precoverage.galoisConnection_toGrothendieck_toPrecoverage C).l_u_le _
343+
274344
end CategoryTheory

0 commit comments

Comments
 (0)