state
stringlengths 0
159k
| srcUpToTactic
stringlengths 387
167k
| nextTactic
stringlengths 3
9k
| declUpToTactic
stringlengths 22
11.5k
| declId
stringlengths 38
95
| decl
stringlengths 16
1.89k
| file_tag
stringlengths 17
73
|
---|---|---|---|---|---|---|
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
⊢ ∃ T ∈ (fun B => {S | ∃ α x X π, S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π)}) Y, Presieve.FactorsThruAlong T S f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
| let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
⊢ ∃ T ∈ (fun B => {S | ∃ α x X π, S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π)}) Y, Presieve.FactorsThruAlong T S f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
| refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩ | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_1
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
⊢ Presieve.ofArrows Z' π' ∈ (fun B => {S | ∃ α x X π, S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π)}) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· | constructor | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_1.h
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
⊢ ∃ x X π, Presieve.ofArrows Z' π' = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π)
case refine_1.w
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
⊢ Type | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
| exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩ | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
⊢ Presieve.ofArrows Z' π' = Presieve.ofArrows Z' π' | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by | simp only | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by | Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_2
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
⊢ Presieve.FactorsThruAlong (Presieve.ofArrows Z' π') S f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· | intro W g hg | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_2
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y : C
f : Y ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y := fun a => pullback.fst
W : C
g : W ⟶ Y
hg : Presieve.ofArrows Z' π' g
⊢ ∃ W_1 i e, S e ∧ i ≫ e = g ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
| rcases hg with ⟨a⟩ | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_2.mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y✝ : C
f : Y✝ ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y✝ := fun a => pullback.fst
Y : C
a : α
⊢ ∃ W i e, S e ∧ i ≫ e = π' a ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
| refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩ | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y✝ : C
f : Y✝ ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y✝ := fun a => pullback.fst
Y : C
a : α
⊢ pullback.snd ≫ π a = π' a ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by | rw [CategoryTheory.Limits.pullback.condition] | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by | Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_2.mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y✝ : C
f : Y✝ ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y✝ := fun a => pullback.fst
Y : C
a : α
⊢ S (π a) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
| rw [hS] | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
case refine_2.mk
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : FinitaryPreExtensive C
X Y✝ : C
f : Y✝ ⟶ X
S : Presieve X
α : Type
hα : Fintype α
Z : α → C
π : (a : α) → Z a ⟶ X
hS : S = Presieve.ofArrows Z π
h_iso : IsIso (Sigma.desc π)
Z' : α → C := fun a => pullback f (π a)
π' : (a : α) → Z' a ⟶ Y✝ := fun a => pullback.fst
Y : C
a : α
⊢ Presieve.ofArrows Z π (π a) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
| exact Presieve.ofArrows.mk a | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
| Mathlib.CategoryTheory.Sites.RegularExtensive.106_0.rkSRr0zuqme90Yu | /--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
α : Type
inst✝ : Fintype α
B : C
X : α → C
π : (a : α) → X a ⟶ B
⊢ EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
| exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩ | theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
| Mathlib.CategoryTheory.Sites.RegularExtensive.127_0.rkSRr0zuqme90Yu | theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
⊢ ∃ β x X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : β), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
| refine ⟨α, inferInstance, ?_⟩ | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
⊢ ∃ X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
| obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁) | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
⊢ ∃ X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
| let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a) | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
⊢ ∃ X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
| let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
⊢ ∃ X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
| let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
⊢ ∃ X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
| have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
⊢ ∃ X₂ π₂, EffectiveEpiFamily X₂ π₂ ∧ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
| refine ⟨X₂, π₂, ?_, ?_⟩ | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
⊢ EffectiveEpiFamily X₂ π₂ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· | have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
⊢ Sigma.desc π' ≫ g = Sigma.desc π₂ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by | ext | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by | Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
b✝ : α
⊢ Sigma.ι (fun b => pullback g' (Sigma.ι X₁ b)) b✝ ≫ Sigma.desc π' ≫ g =
Sigma.ι (fun b => pullback g' (Sigma.ι X₁ b)) b✝ ≫ Sigma.desc π₂ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; | simp | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; | Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
this : Sigma.desc π' ≫ g = Sigma.desc π₂
⊢ EffectiveEpiFamily X₂ π₂ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
| rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this] | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
this : Sigma.desc π' ≫ g = Sigma.desc π₂
⊢ EffectiveEpi (Sigma.desc π' ≫ g) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
| infer_instance | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
⊢ ∃ i ι, ∀ (b : α), ι b ≫ π₁ (i b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· | refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩ | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· | Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
b : α
⊢ (fun b => pullback.snd) b ≫ π₁ (id b) = π₂ b ≫ f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
| simp only [id_eq, Category.assoc, ← hg] | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
b : α
⊢ pullback.snd ≫ π₁ b = pullback.fst ≫ g' ≫ Sigma.desc π₁ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
| rw [← Category.assoc, pullback.condition] | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro.intro.refine_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : FinitaryPreExtensive C
inst✝ : Preregular C
B₁ B₂ : C
f : B₂ ⟶ B₁
α : Type
x✝¹ : Fintype α
X₁ : α → C
π₁ : (a : α) → X₁ a ⟶ B₁
h : EffectiveEpiFamily X₁ π₁
Y : C
g : Y ⟶ B₂
w✝ : EffectiveEpi g
g' : Y ⟶ ∐ fun b => X₁ b
hg : g' ≫ Sigma.desc π₁ = g ≫ f
X₂ : α → C := fun a => pullback g' (Sigma.ι X₁ a)
π₂ : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ B₂ := fun a => pullback.fst ≫ g
π' : (a : α) → pullback g' (Sigma.ι X₁ a) ⟶ Y := fun a => pullback.fst
x✝ : IsIso (Sigma.desc fun x => pullback.fst)
b : α
⊢ pullback.snd ≫ π₁ b = (pullback.snd ≫ Sigma.ι X₁ b) ≫ Sigma.desc π₁ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
| simp | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
| Mathlib.CategoryTheory.Sites.RegularExtensive.134_0.rkSRr0zuqme90Yu | instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
⊢ Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C) = coherentTopology C | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
| ext B S | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
⊢ S ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) B ↔
S ∈ GrothendieckTopology.sieves (coherentTopology C) B | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
| refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
h : S ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) B
⊢ S ∈ GrothendieckTopology.sieves (coherentTopology C) B | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· | induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
h : S ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) B
⊢ S ∈ GrothendieckTopology.sieves (coherentTopology C) B | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· | induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.of
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
hT : T ∈ Coverage.covering (extensiveCoverage C ⊔ regularCoverage C) Y
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (coherentTopology C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| | of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩) | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.of
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
hT : T ∈ Coverage.covering (extensiveCoverage C ⊔ regularCoverage C) Y
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (coherentTopology C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
| apply Coverage.saturate.of | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.of.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
hT : T ∈ Coverage.covering (extensiveCoverage C ⊔ regularCoverage C) Y
⊢ T ∈ Coverage.covering (coherentCoverage C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
| simp only [Coverage.sup_covering, Set.mem_union] at hT | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.of.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
hT : T ∈ Coverage.covering (extensiveCoverage C) Y ∨ T ∈ Coverage.covering (regularCoverage C) Y
⊢ T ∈ Coverage.covering (coherentCoverage C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
| exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩) | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.top
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
X✝ : C
⊢ ⊤ ∈ GrothendieckTopology.sieves (coherentTopology C) X✝ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| | top => apply Coverage.saturate.top | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.top
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
X✝ : C
⊢ ⊤ ∈ GrothendieckTopology.sieves (coherentTopology C) X✝ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => | apply Coverage.saturate.top | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.transitive
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y T
a✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (coherentTopology C) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Sieve.pullback f S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y_1
⊢ S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| | transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.transitive
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y T
a✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (coherentTopology C) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Sieve.pullback f S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y_1
⊢ S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => | apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.transitive
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y T
a✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (coherentTopology C) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Sieve.pullback f S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y_1
⊢ S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => | apply Coverage.saturate.transitive Y T | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.transitive.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y T
a✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (coherentTopology C) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Sieve.pullback f S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y_1
⊢ Coverage.saturate (coherentCoverage C) Y T | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [ | assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [ | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_1.transitive.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y T
a✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (coherentTopology C) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Sieve.pullback f S✝ ∈ GrothendieckTopology.sieves (coherentTopology C) Y_1
⊢ ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Coverage.saturate (coherentCoverage C) Y_1 (Sieve.pullback f S✝) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; | assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
h : S ∈ GrothendieckTopology.sieves (coherentTopology C) B
⊢ S ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) B | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· | induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
h : S ∈ GrothendieckTopology.sieves (coherentTopology C) B
⊢ S ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) B | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· | induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
hT : T ∈ Coverage.covering (coherentCoverage C) Y
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| | of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
hT : T ∈ Coverage.covering (coherentCoverage C) Y
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
| obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
| let φ := fun (i : I) ↦ Sigma.ι X i | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
| let F := Sigma.desc f | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
| let Z := Sieve.generate T | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
| let Xs := (∐ fun (i : I) => X i) | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
| let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F)) | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
⊢ Sieve.generate T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
| apply Coverage.saturate.transitive Y Zf | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y Zf | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· | apply Coverage.saturate.of | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
⊢ (Presieve.ofArrows (fun x => Xs) fun x => F) ∈ Coverage.covering (extensiveCoverage C ⊔ regularCoverage C) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
| simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
⊢ (∃ α x X_1 π,
(Presieve.ofArrows (fun x => ∐ fun i => X i) fun x => Sigma.desc f) = Presieve.ofArrows X_1 π ∧
IsIso (Sigma.desc π)) ∨
∃ X_1 f_1,
((Presieve.ofArrows (fun x => ∐ fun i => X i) fun x => Sigma.desc f) =
Presieve.ofArrows (fun x => X_1) fun x => f_1) ∧
EffectiveEpi f_1 | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
| exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩ | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
⊢ ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
Zf.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f (Sieve.generate T)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· | intro R g hZfg | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
hZfg : Zf.arrows g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback g (Sieve.generate T)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
| dsimp at hZfg | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
hZfg : ∃ Y_1 h g_1, Presieve.ofArrows (fun x => ∐ fun i => X i) (fun x => Sigma.desc f) g_1 ∧ h ≫ g_1 = g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback g (Sieve.generate T)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
| rw [Presieve.ofArrows_pUnit] at hZfg | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
hZfg : ∃ Y_1 h g_1, Presieve.singleton (Sigma.desc f) g_1 ∧ h ≫ g_1 = g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback g (Sieve.generate T)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
| obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
ψ : R ⟶ W
σ : W ⟶ Y
hW : Presieve.singleton (Sigma.desc f) σ
hW' : ψ ≫ σ = g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback g (Sieve.generate T)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
| induction hW | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback g (Sieve.generate T)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
| rw [← hW', Sieve.pullback_comp Z] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback ψ (Sieve.pullback (Sigma.desc f) Z)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
| suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this :
Sieve.pullback ψ (Sieve.pullback F Z) ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) R
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) R (Sieve.pullback ψ (Sieve.pullback (Sigma.desc f) Z)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by | assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
⊢ Sieve.pullback ψ (Sieve.pullback F Z) ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) R | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
| apply GrothendieckTopology.pullback_stable' | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
⊢ Sieve.pullback F Z ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) (∐ fun i => X i) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
| suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Xs (Sieve.pullback F Z)
⊢ Sieve.pullback F Z ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) (∐ fun i => X i) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by | assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Xs (Sieve.pullback F Z) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
| suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Xs (Sieve.pullback F Z) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· | apply Coverage.saturate_of_superset _ this | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) (∐ X) (Sieve.generate (Presieve.ofArrows X φ)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
| apply Coverage.saturate.of | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
⊢ Presieve.ofArrows X φ ∈ Coverage.covering (extensiveCoverage C ⊔ regularCoverage C) (∐ X) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
| simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
⊢ (∃ α x X_1 π, (Presieve.ofArrows X fun i => Sigma.ι X i) = Presieve.ofArrows X_1 π ∧ IsIso (Sigma.desc π)) ∨
∃ X_1 f, ((Presieve.ofArrows X fun i => Sigma.ι X i) = Presieve.ofArrows (fun x => X_1) fun x => f) ∧ EffectiveEpi f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
| refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩ | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
⊢ IsIso (Sigma.desc φ) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
| suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this✝ : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
this : Sigma.desc φ = 𝟙 (∐ fun b => X b)
⊢ IsIso (Sigma.desc φ) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by | rw [this] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this✝ : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
this : Sigma.desc φ = 𝟙 (∐ fun b => X b)
⊢ IsIso (𝟙 (∐ fun b => X b)) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; | infer_instance | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a.hS
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
⊢ Sigma.desc φ = 𝟙 (∐ fun b => X b) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
| ext | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.of.intro.intro.intro.intro.intro.a.intro.intro.intro.intro.mk.a.hS.h
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
this : Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z
b✝ : I
⊢ Sigma.ι (fun b => X b) b✝ ≫ Sigma.desc φ = Sigma.ι (fun b => X b) b✝ ≫ 𝟙 (∐ fun b => X b) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
| simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
⊢ Sieve.generate (Presieve.ofArrows X φ) ≤ Sieve.pullback F Z | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
| intro Q q hq | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
hq : (Sieve.generate (Presieve.ofArrows X φ)).arrows q
⊢ (Sieve.pullback F Z).arrows q | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
| simp only [Sieve.pullback_apply, Sieve.generate_apply] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
hq : (Sieve.generate (Presieve.ofArrows X φ)).arrows q
⊢ ∃ Y_1 h g, T g ∧ h ≫ g = q ≫ Sigma.desc f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
| simp only [Sieve.generate_apply] at hq | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
hq : ∃ Y h g, Presieve.ofArrows X (fun i => Sigma.ι X i) g ∧ h ≫ g = q
⊢ ∃ Y_1 h g, T g ∧ h ≫ g = q ≫ Sigma.desc f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
| obtain ⟨E, e, r, hq⟩ := hq | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
e : Q ⟶ E
r : E ⟶ ∐ X
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) r ∧ e ≫ r = q
⊢ ∃ Y_1 h g, T g ∧ h ≫ g = q ≫ Sigma.desc f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
| refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩ | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro.refine'_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
e : Q ⟶ E
r : E ⟶ ∐ X
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) r ∧ e ≫ r = q
⊢ T (r ≫ F) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· | rw [h] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro.refine'_1
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
e : Q ⟶ E
r : E ⟶ ∐ X
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) r ∧ e ≫ r = q
⊢ Presieve.ofArrows X f (r ≫ F) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
| induction hq.1 | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro.refine'_1.mk
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
r : E ⟶ ∐ X
i✝ : I
e : Q ⟶ X i✝
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) (Sigma.ι X i✝) ∧ e ≫ Sigma.ι X i✝ = q
⊢ Presieve.ofArrows X f (Sigma.ι X i✝ ≫ F) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
| simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro.refine'_1.mk
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
r : E ⟶ ∐ X
i✝ : I
e : Q ⟶ X i✝
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) (Sigma.ι X i✝) ∧ e ≫ Sigma.ι X i✝ = q
⊢ Presieve.ofArrows X f (f i✝) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
| exact Presieve.ofArrows.mk _ | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro.refine'_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
e : Q ⟶ E
r : E ⟶ ∐ X
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) r ∧ e ≫ r = q
⊢ e ≫ r ≫ F = q ≫ Sigma.desc f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· | rw [← hq.2] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case this.intro.intro.intro.refine'_2
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T : Presieve Y
I : Type
hI : Fintype I
X : I → C
f : (a : I) → X a ⟶ Y
h : T = Presieve.ofArrows X f
hT : EffectiveEpiFamily X f
φ : (i : I) → X i ⟶ ∐ X := fun i => Sigma.ι X i
F : (∐ fun b => X b) ⟶ Y := Sigma.desc f
Z : Sieve Y := Sieve.generate T
Xs : C := ∐ fun i => X i
Zf : Sieve Y := Sieve.generate (Presieve.ofArrows (fun x => Xs) fun x => F)
R : C
g : R ⟶ Y
W : C
σ : W ⟶ Y
ψ : R ⟶ ∐ fun i => X i
hW' : ψ ≫ Sigma.desc f = g
Q : C
q : Q ⟶ ∐ X
E : C
e : Q ⟶ E
r : E ⟶ ∐ X
hq : Presieve.ofArrows X (fun i => Sigma.ι X i) r ∧ e ≫ r = q
⊢ e ≫ r ≫ F = (e ≫ r) ≫ Sigma.desc f | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
| simp only [Category.assoc] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.top
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
X✝ : C
⊢ ⊤ ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) X✝ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| | top => apply Coverage.saturate.top | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.top
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
X✝ : C
⊢ ⊤ ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) X✝ | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => | apply Coverage.saturate.top | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.transitive
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (coherentCoverage C) Y T
a✝ : ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Coverage.saturate (coherentCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f →
Sieve.pullback f S✝ ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y_1
⊢ S✝ ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| | transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.transitive
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (coherentCoverage C) Y T
a✝ : ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Coverage.saturate (coherentCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f →
Sieve.pullback f S✝ ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y_1
⊢ S✝ ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => | apply Coverage.saturate.transitive Y T<;> [assumption; assumption] | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.transitive
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (coherentCoverage C) Y T
a✝ : ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Coverage.saturate (coherentCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f →
Sieve.pullback f S✝ ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y_1
⊢ S✝ ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => | apply Coverage.saturate.transitive Y T | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.transitive.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (coherentCoverage C) Y T
a✝ : ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Coverage.saturate (coherentCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f →
Sieve.pullback f S✝ ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y_1
⊢ Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y T | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [ | assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [ | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
case h.h.h.refine_2.transitive.a
C : Type u
inst✝² : Category.{v, u} C
inst✝¹ : Preregular C
inst✝ : FinitaryPreExtensive C
B : C
S : Sieve B
Y : C
T S✝ : Sieve Y
a✝¹ : Coverage.saturate (coherentCoverage C) Y T
a✝ : ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄, T.arrows f → Coverage.saturate (coherentCoverage C) Y_1 (Sieve.pullback f S✝)
a_ih✝¹ : T ∈ GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y
a_ih✝ :
∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f →
Sieve.pullback f S✝ ∈
GrothendieckTopology.sieves (Coverage.toGrothendieck C (extensiveCoverage C ⊔ regularCoverage C)) Y_1
⊢ ∀ ⦃Y_1 : C⦄ ⦃f : Y_1 ⟶ Y⦄,
T.arrows f → Coverage.saturate (extensiveCoverage C ⊔ regularCoverage C) Y_1 (Sieve.pullback f S✝) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; | assumption | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; | Mathlib.CategoryTheory.Sites.RegularExtensive.151_0.rkSRr0zuqme90Yu | /-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝ : Category.{v, u} C
P : Cᵒᵖ ⥤ Type (max u v)
W X B : C
f : X ⟶ B
g₁ g₂ : W ⟶ X
w : g₁ ≫ f = g₂ ≫ f
t : P.obj (op B)
⊢ P.map f.op t ∈ {x | P.map g₁.op x = P.map g₂.op x} | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
section RegularSheaves
variable {C}
open Opposite Presieve
/-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
/-- `R` consists of a single epimorphism. -/
single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
namespace regularCoverage
/--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } := fun t ↦
⟨P.map f.op t, by | simp only [Set.mem_setOf_eq, ← FunctorToTypes.map_comp_apply, ← op_comp, w] | /--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } := fun t ↦
⟨P.map f.op t, by | Mathlib.CategoryTheory.Sites.RegularExtensive.227_0.rkSRr0zuqme90Yu | /--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } | Mathlib_CategoryTheory_Sites_RegularExtensive |
C : Type u
inst✝² : Category.{v, u} C
B : C
S : Presieve B
inst✝¹ : regular S
inst✝ : hasPullbacks S
F : Cᵒᵖ ⥤ Type (max u v)
hF : EqualizerCondition F
⊢ IsSheafFor F S | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
section RegularSheaves
variable {C}
open Opposite Presieve
/-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
/-- `R` consists of a single epimorphism. -/
single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
namespace regularCoverage
/--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } := fun t ↦
⟨P.map f.op t, by simp only [Set.mem_setOf_eq, ← FunctorToTypes.map_comp_apply, ← op_comp, w]⟩
/--
The sheaf condition with respect to regular presieves, given the existence of the relavant pullback.
-/
def EqualizerCondition (P : Cᵒᵖ ⥤ Type (max u v)) : Prop :=
∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π], Function.Bijective
(MapToEqualizer P π (pullback.fst (f := π) (g := π)) (pullback.snd (f := π) (g := π))
pullback.condition)
lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
| obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S) | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
| Mathlib.CategoryTheory.Sites.RegularExtensive.243_0.rkSRr0zuqme90Yu | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
B : C
S : Presieve B
inst✝¹ : regular S
inst✝ : hasPullbacks S
F : Cᵒᵖ ⥤ Type (max u v)
hF : EqualizerCondition F
X : C
π : X ⟶ B
hS : S = ofArrows (fun x => X) fun x => π
πsurj : EffectiveEpi π
⊢ IsSheafFor F S | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
section RegularSheaves
variable {C}
open Opposite Presieve
/-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
/-- `R` consists of a single epimorphism. -/
single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
namespace regularCoverage
/--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } := fun t ↦
⟨P.map f.op t, by simp only [Set.mem_setOf_eq, ← FunctorToTypes.map_comp_apply, ← op_comp, w]⟩
/--
The sheaf condition with respect to regular presieves, given the existence of the relavant pullback.
-/
def EqualizerCondition (P : Cᵒᵖ ⥤ Type (max u v)) : Prop :=
∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π], Function.Bijective
(MapToEqualizer P π (pullback.fst (f := π) (g := π)) (pullback.snd (f := π) (g := π))
pullback.condition)
lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S)
| subst hS | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S)
| Mathlib.CategoryTheory.Sites.RegularExtensive.243_0.rkSRr0zuqme90Yu | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
B : C
F : Cᵒᵖ ⥤ Type (max u v)
hF : EqualizerCondition F
X : C
π : X ⟶ B
πsurj : EffectiveEpi π
inst✝¹ : regular (ofArrows (fun x => X) fun x => π)
inst✝ : hasPullbacks (ofArrows (fun x => X) fun x => π)
⊢ IsSheafFor F (ofArrows (fun x => X) fun x => π) | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
section RegularSheaves
variable {C}
open Opposite Presieve
/-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
/-- `R` consists of a single epimorphism. -/
single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
namespace regularCoverage
/--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } := fun t ↦
⟨P.map f.op t, by simp only [Set.mem_setOf_eq, ← FunctorToTypes.map_comp_apply, ← op_comp, w]⟩
/--
The sheaf condition with respect to regular presieves, given the existence of the relavant pullback.
-/
def EqualizerCondition (P : Cᵒᵖ ⥤ Type (max u v)) : Prop :=
∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π], Function.Bijective
(MapToEqualizer P π (pullback.fst (f := π) (g := π)) (pullback.snd (f := π) (g := π))
pullback.condition)
lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S)
subst hS
| rw [isSheafFor_arrows_iff_pullbacks] | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S)
subst hS
| Mathlib.CategoryTheory.Sites.RegularExtensive.243_0.rkSRr0zuqme90Yu | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F | Mathlib_CategoryTheory_Sites_RegularExtensive |
case intro.intro.intro
C : Type u
inst✝² : Category.{v, u} C
B : C
F : Cᵒᵖ ⥤ Type (max u v)
hF : EqualizerCondition F
X : C
π : X ⟶ B
πsurj : EffectiveEpi π
inst✝¹ : regular (ofArrows (fun x => X) fun x => π)
inst✝ : hasPullbacks (ofArrows (fun x => X) fun x => π)
⊢ ∀ (x : Unit → F.obj (op X)), Arrows.PullbackCompatible F (fun x => π) x → ∃! t, ∀ (i : Unit), F.map π.op t = x i | /-
Copyright (c) 2023 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson, Filippo A. E. Nuccio, Riccardo Brasca
-/
import Mathlib.CategoryTheory.Extensive
import Mathlib.CategoryTheory.Preadditive.Projective
import Mathlib.CategoryTheory.Sites.Coherent
import Mathlib.CategoryTheory.Sites.Preserves
/-!
# The Regular and Extensive Coverages
This file defines two coverages on a category `C`.
The first one is called the *regular* coverage and for that to exist, the category `C` must satisfy
a condition called `Preregular C`. This means that effective epimorphisms can be "pulled back". The
covering sieves of this coverage are generated by presieves consisting of a single effective
epimorphism.
The second one is called the *extensive* coverage and for that to exist, the category `C` must
satisfy a condition called `FinitaryPreExtensive C`. This means `C` has finite coproducts and that
those are preserved by pullbacks. The covering sieves of this coverage are generated by presieves
consisting finitely many arrows that together induce an isomorphism from the coproduct to the
target. This condition is weaker than `FinitaryExtensive`, where in addition finite coproducts are
disjoint.
## Main results
* `instance : Precoherent C` given `Preregular C` and `FinitaryPreExtensive C`.
* `extensive_union_regular_generates_coherent`: the union of the regular and extensive coverages
generates the coherent topology on `C` if `C` is precoherent, preextensive and preregular.
* `isSheaf_iff_equalizerCondition`: In a preregular category with pullbacks, the sheaves for the
regular topology are precisely the presheaves satisfying an equaliser condition with respect to
effective epimorphisms.
* `isSheaf_of_projective`: In a preregular category in which every object is projective, every
presheaf is a sheaf for the regular topology.
* `isSheaf_iff_preservesFiniteProducts`: In a finitary extensive category, the sheaves for the
extensive topology are precisely those preserving finite products.
-/
universe v u w
namespace CategoryTheory
open Limits
variable (C : Type u) [Category.{v} C]
/--
The condition `Preregular C` is property that effective epis can be "pulled back" along any
morphism. This is satisfied e.g. by categories that have pullbacks that preserve effective
epimorphisms (like `Profinite` and `CompHaus`), and categories where every object is projective
(like `Stonean`).
-/
class Preregular : Prop where
/--
For `X`, `Y`, `Z`, `f`, `g` like in the diagram, where `g` is an effective epi, there exists
an object `W`, an effective epi `h : W ⟶ X` and a morphism `i : W ⟶ Z` making the diagram
commute.
```
W --i-→ Z
| |
h g
↓ ↓
X --f-→ Y
```
-/
exists_fac : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ Y) [EffectiveEpi g],
(∃ (W : C) (h : W ⟶ X) (_ : EffectiveEpi h) (i : W ⟶ Z), i ≫ g = h ≫ f)
instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where
exists_fac {X Y Z} f g _ := by
have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g)
simp only [exists_const] at hp
rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp
obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance
refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩
ext b
simpa using hι b
/--
The regular coverage on a regular category `C`.
-/
def regularCoverage [Preregular C] : Coverage C where
covering B := { S | ∃ (X : C) (f : X ⟶ B), S = Presieve.ofArrows (fun (_ : Unit) ↦ X)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f }
pullback := by
intro X Y f S ⟨Z, π, hπ, h_epi⟩
have := Preregular.exists_fac f π
obtain ⟨W, h, _, i, this⟩ := this
refine ⟨Presieve.singleton h, ⟨?_, ?_⟩⟩
· exact ⟨W, h, by {rw [Presieve.ofArrows_pUnit h]}, inferInstance⟩
· intro W g hg
cases hg
refine ⟨Z, i, π, ⟨?_, this⟩⟩
cases hπ
rw [Presieve.ofArrows_pUnit]
exact Presieve.singleton.mk
/--
The extensive coverage on an extensive category `C`
TODO: use general colimit API instead of `IsIso (Sigma.desc π)`
-/
def extensiveCoverage [FinitaryPreExtensive C] : Coverage C where
covering B := { S | ∃ (α : Type) (_ : Fintype α) (X : α → C) (π : (a : α) → (X a ⟶ B)),
S = Presieve.ofArrows X π ∧ IsIso (Sigma.desc π) }
pullback := by
intro X Y f S ⟨α, hα, Z, π, hS, h_iso⟩
let Z' : α → C := fun a ↦ pullback f (π a)
let π' : (a : α) → Z' a ⟶ Y := fun a ↦ pullback.fst
refine ⟨@Presieve.ofArrows C _ _ α Z' π', ⟨?_, ?_⟩⟩
· constructor
exact ⟨hα, Z', π', ⟨by simp only, FinitaryPreExtensive.sigma_desc_iso (fun x => π x) f h_iso⟩⟩
· intro W g hg
rcases hg with ⟨a⟩
refine ⟨Z a, pullback.snd, π a, ?_, by rw [CategoryTheory.Limits.pullback.condition]⟩
rw [hS]
exact Presieve.ofArrows.mk a
theorem effectiveEpi_desc_iff_effectiveEpiFamily [FinitaryPreExtensive C] {α : Type} [Fintype α]
{B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π := by
exact ⟨fun h ↦ ⟨⟨@effectiveEpiFamilyStructOfEffectiveEpiDesc _ _ _ _ X π _ h _ _ (fun g ↦
(FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X a) g inferInstance).epi_of_iso)⟩⟩,
fun _ ↦ inferInstance⟩
instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where
pullback {B₁ B₂} f α _ X₁ π₁ h := by
refine ⟨α, inferInstance, ?_⟩
obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁)
let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a)
let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g
let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a)
have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance
refine ⟨X₂, π₂, ?_, ?_⟩
· have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp
rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this]
infer_instance
· refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩
simp only [id_eq, Category.assoc, ← hg]
rw [← Category.assoc, pullback.condition]
simp
/-- The union of the extensive and regular coverages generates the coherent topology on `C`. -/
lemma extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] :
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck =
(coherentTopology C) := by
ext B S
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· induction h with
| of Y T hT =>
apply Coverage.saturate.of
simp only [Coverage.sup_covering, Set.mem_union] at hT
exact Or.elim hT
(fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩)
(fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩)
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
· induction h with
| of Y T hT =>
obtain ⟨I, hI, X, f, ⟨h, hT⟩⟩ := hT
let φ := fun (i : I) ↦ Sigma.ι X i
let F := Sigma.desc f
let Z := Sieve.generate T
let Xs := (∐ fun (i : I) => X i)
let Zf := Sieve.generate (Presieve.ofArrows (fun (_ : Unit) ↦ Xs) (fun (_ : Unit) ↦ F))
apply Coverage.saturate.transitive Y Zf
· apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
exact Or.inr ⟨Xs, F, ⟨rfl, inferInstance⟩⟩
· intro R g hZfg
dsimp at hZfg
rw [Presieve.ofArrows_pUnit] at hZfg
obtain ⟨W, ψ, σ, ⟨hW, hW'⟩⟩ := hZfg
induction hW
rw [← hW', Sieve.pullback_comp Z]
suffices Sieve.pullback ψ ((Sieve.pullback F) Z) ∈ GrothendieckTopology.sieves
((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck R by assumption
apply GrothendieckTopology.pullback_stable'
suffices Coverage.saturate ((extensiveCoverage C) ⊔ (regularCoverage C)) Xs
(Z.pullback F) by assumption
suffices : Sieve.generate (Presieve.ofArrows X φ) ≤ Z.pullback F
· apply Coverage.saturate_of_superset _ this
apply Coverage.saturate.of
simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union,
Set.mem_setOf_eq]
refine Or.inl ⟨I, hI, X, φ, ⟨rfl, ?_⟩⟩
suffices Sigma.desc φ = 𝟙 _ by rw [this]; infer_instance
ext
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app, Category.comp_id]
intro Q q hq
simp only [Sieve.pullback_apply, Sieve.generate_apply]
simp only [Sieve.generate_apply] at hq
obtain ⟨E, e, r, hq⟩ := hq
refine' ⟨E, e, r ≫ F, ⟨_, _⟩⟩
· rw [h]
induction hq.1
simp only [colimit.ι_desc, Cofan.mk_pt, Cofan.mk_ι_app]
exact Presieve.ofArrows.mk _
· rw [← hq.2]
simp only [Category.assoc]
| top => apply Coverage.saturate.top
| transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
section RegularSheaves
variable {C}
open Opposite Presieve
/-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
/-- `R` consists of a single epimorphism. -/
single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
(fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
namespace regularCoverage
/--
The map to the explicit equalizer used in the sheaf condition.
-/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type (max u v)) {W X B : C} (f : X ⟶ B)
(g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } := fun t ↦
⟨P.map f.op t, by simp only [Set.mem_setOf_eq, ← FunctorToTypes.map_comp_apply, ← op_comp, w]⟩
/--
The sheaf condition with respect to regular presieves, given the existence of the relavant pullback.
-/
def EqualizerCondition (P : Cᵒᵖ ⥤ Type (max u v)) : Prop :=
∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π], Function.Bijective
(MapToEqualizer P π (pullback.fst (f := π) (g := π)) (pullback.snd (f := π) (g := π))
pullback.condition)
lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S)
subst hS
rw [isSheafFor_arrows_iff_pullbacks]
| intro y h | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F := by
obtain ⟨X, π, hS, πsurj⟩ := Presieve.regular.single_epi (R := S)
subst hS
rw [isSheafFor_arrows_iff_pullbacks]
| Mathlib.CategoryTheory.Sites.RegularExtensive.243_0.rkSRr0zuqme90Yu | lemma EqualizerCondition.isSheafFor {B : C} {S : Presieve B} [S.regular] [S.hasPullbacks]
{F : Cᵒᵖ ⥤ Type (max u v)}
(hF : EqualizerCondition F) : S.IsSheafFor F | Mathlib_CategoryTheory_Sites_RegularExtensive |
Subsets and Splits