Theorem: CategoryTheory.classifier_isSheaf
File: Mathlib/CategoryTheory/Sites/Closed.lean

tactic: intro X S hS
state_before: C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
⊢ Presieve.IsSheaf J₁ (Functor.closedSieves J₁)

tactic: rw [← Presieve.isSeparatedFor_and_exists_isAmalgamation_iff_isSheafFor]
state_before: C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
⊢ Presieve.IsSheafFor (Functor.closedSieves J₁) S.arrows

tactic: refine' ⟨_, _⟩
state_before: C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
⊢ Presieve.IsSeparatedFor (Functor.closedSieves J₁) S.arrows ∧
    ∀ (x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows),
      Presieve.FamilyOfElements.Compatible x → ∃ t, Presieve.FamilyOfElements.IsAmalgamation x t

tactic: rintro x ⟨M, hM⟩ ⟨N, hN⟩ hM₂ hN₂
state_before: case refine'_1
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
⊢ Presieve.IsSeparatedFor (Functor.closedSieves J₁) S.arrows

tactic: simp only [Functor.closedSieves_obj]
state_before: case refine'_1.mk.mk
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
⊢ { val := M, property := hM } = { val := N, property := hN }

tactic: ext Y
state_before: case refine'_1.mk.mk
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
⊢ { val := M, property := hM } = { val := N, property := hN }

tactic: intro f
state_before: case refine'_1.mk.mk.a.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
⊢ ∀ (f : Y ⟶ X.op.unop), (↑{ val := M, property := hM }).arrows f ↔ (↑{ val := N, property := hN }).arrows f

tactic: dsimp only [Subtype.coe_mk]
state_before: case refine'_1.mk.mk.a.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
⊢ (↑{ val := M, property := hM }).arrows f ↔ (↑{ val := N, property := hN }).arrows f

tactic: rw [← J₁.covers_iff_mem_of_isClosed hM, ← J₁.covers_iff_mem_of_isClosed hN]
state_before: case refine'_1.mk.mk.a.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
⊢ M.arrows f ↔ N.arrows f

tactic: have q : ∀ ⦃Z : C⦄ (g : Z ⟶ X) (_ : S g), M.pullback g = N.pullback g :=
  fun Z g hg => congr_arg Subtype.val ((hM₂ g hg).trans (hN₂ g hg).symm)
state_before: case refine'_1.mk.mk.a.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
⊢ GrothendieckTopology.Covers J₁ M f ↔ GrothendieckTopology.Covers J₁ N f

tactic: have MSNS : M ⊓ S = N ⊓ S := by
  ext Z
  intro g
  rw [Sieve.inter_apply, Sieve.inter_apply]
  simp only [and_comm]
  apply and_congr_right
  intro hg
  rw [Sieve.pullback_eq_top_iff_mem, Sieve.pullback_eq_top_iff_mem, q g hg]
state_before: case refine'_1.mk.mk.a.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
⊢ GrothendieckTopology.Covers J₁ M f ↔ GrothendieckTopology.Covers J₁ N f

tactic: constructor
state_before: case refine'_1.mk.mk.a.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
⊢ GrothendieckTopology.Covers J₁ M f ↔ GrothendieckTopology.Covers J₁ N f

tactic: ext Z
state_before: C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
⊢ M ⊓ S = N ⊓ S

tactic: intro g
state_before: case h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
Z : C
⊢ ∀ (f : Z ⟶ X.op.unop), (M ⊓ S).arrows f ↔ (N ⊓ S).arrows f

tactic: rw [Sieve.inter_apply, Sieve.inter_apply]
state_before: case h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
Z : C
g : Z ⟶ X.op.unop
⊢ (M ⊓ S).arrows g ↔ (N ⊓ S).arrows g

tactic: simp only [and_comm]
state_before: case h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
Z : C
g : Z ⟶ X.op.unop
⊢ M.arrows g ∧ S.arrows g ↔ N.arrows g ∧ S.arrows g

tactic: apply and_congr_right
state_before: case h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
Z : C
g : Z ⟶ X.op.unop
⊢ S.arrows g ∧ M.arrows g ↔ S.arrows g ∧ N.arrows g

tactic: intro hg
state_before: case h.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
Z : C
g : Z ⟶ X.op.unop
⊢ S.arrows g → (M.arrows g ↔ N.arrows g)

tactic: rw [Sieve.pullback_eq_top_iff_mem, Sieve.pullback_eq_top_iff_mem, q g hg]
state_before: case h.h
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
Z : C
g : Z ⟶ X.op.unop
hg : S.arrows g
⊢ M.arrows g ↔ N.arrows g

tactic: intro hf
state_before: case refine'_1.mk.mk.a.h.mp
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
⊢ GrothendieckTopology.Covers J₁ M f → GrothendieckTopology.Covers J₁ N f

tactic: rw [J₁.covers_iff]
state_before: case refine'_1.mk.mk.a.h.mp
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ M f
⊢ GrothendieckTopology.Covers J₁ N f

tactic: apply J₁.superset_covering (Sieve.pullback_monotone f inf_le_left)
state_before: case refine'_1.mk.mk.a.h.mp
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ M f
⊢ Sieve.pullback f N ∈ GrothendieckTopology.sieves J₁ Y

tactic: rw [← MSNS]
state_before: case refine'_1.mk.mk.a.h.mp
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ M f
⊢ Sieve.pullback f (N ⊓ ?m.20451) ∈ GrothendieckTopology.sieves J₁ Y

C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ M f
⊢ Sieve X.op.unop

tactic: apply J₁.arrow_intersect f M S hf (J₁.pullback_stable _ hS)
state_before: case refine'_1.mk.mk.a.h.mp
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ M f
⊢ Sieve.pullback f (M ⊓ S) ∈ GrothendieckTopology.sieves J₁ Y

tactic: intro hf
state_before: case refine'_1.mk.mk.a.h.mpr
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
⊢ GrothendieckTopology.Covers J₁ N f → GrothendieckTopology.Covers J₁ M f

tactic: rw [J₁.covers_iff]
state_before: case refine'_1.mk.mk.a.h.mpr
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ N f
⊢ GrothendieckTopology.Covers J₁ M f

tactic: apply J₁.superset_covering (Sieve.pullback_monotone f inf_le_left)
state_before: case refine'_1.mk.mk.a.h.mpr
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ N f
⊢ Sieve.pullback f M ∈ GrothendieckTopology.sieves J₁ Y

tactic: rw [MSNS]
state_before: case refine'_1.mk.mk.a.h.mpr
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ N f
⊢ Sieve.pullback f (M ⊓ ?m.20658) ∈ GrothendieckTopology.sieves J₁ Y

C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ N f
⊢ Sieve X.op.unop

tactic: apply J₁.arrow_intersect f N S hf (J₁.pullback_stable _ hS)
state_before: case refine'_1.mk.mk.a.h.mpr
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
M : Sieve X.op.unop
hM : GrothendieckTopology.IsClosed J₁ M
N : Sieve X.op.unop
hN : GrothendieckTopology.IsClosed J₁ N
hM₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := M, property := hM }
hN₂ : Presieve.FamilyOfElements.IsAmalgamation x { val := N, property := hN }
Y : C
f : Y ⟶ X.op.unop
q : ∀ ⦃Z : C⦄ (g : Z ⟶ X), S.arrows g → Sieve.pullback g M = Sieve.pullback g N
MSNS : M ⊓ S = N ⊓ S
hf : GrothendieckTopology.Covers J₁ N f
⊢ Sieve.pullback f (N ⊓ S) ∈ GrothendieckTopology.sieves J₁ Y

tactic: intro x hx
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
⊢ ∀ (x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows),
    Presieve.FamilyOfElements.Compatible x → ∃ t, Presieve.FamilyOfElements.IsAmalgamation x t

tactic: rw [Presieve.compatible_iff_sieveCompatible] at hx
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.Compatible x
⊢ ∃ t, Presieve.FamilyOfElements.IsAmalgamation x t

tactic: let M := Sieve.bind S fun Y f hf => (x f hf).1
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
⊢ ∃ t, Presieve.FamilyOfElements.IsAmalgamation x t

tactic: refine' ⟨⟨_, J₁.close_isClosed M⟩, _⟩
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
⊢ ∃ t, Presieve.FamilyOfElements.IsAmalgamation x t

tactic: intro Y f hf
state_before: C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
⊢ ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)

tactic: apply le_antisymm
state_before: C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ Sieve.pullback f M = ↑(x f hf)

tactic: rintro Z u ⟨W, g, f', hf', hg : (x f' hf').1 _, c⟩
state_before: case a
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ Sieve.pullback f M ≤ ↑(x f hf)

tactic: rw [Sieve.pullback_eq_top_iff_mem,
  ← show (x (u ≫ f) _).1 = (x f hf).1.pullback u from congr_arg Subtype.val (hx f u hf)]
state_before: case a.intro.intro.intro.intro.intro
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
Z : C
u : Z ⟶ Y
W : C
g : Z ⟶ W
f' : W ⟶ X
hf' : S.arrows f'
hg : (↑(x f' hf')).arrows g
c : g ≫ f' = u ≫ f
⊢ (↑(x f hf)).arrows u

tactic: conv_lhs => congr; congr; rw [← c]
state_before: case a.intro.intro.intro.intro.intro
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
Z : C
u : Z ⟶ Y
W : C
g : Z ⟶ W
f' : W ⟶ X
hf' : S.arrows f'
hg : (↑(x f' hf')).arrows g
c : g ≫ f' = u ≫ f
⊢ ↑(x (u ≫ f) (_ : S.arrows (u ≫ f))) = ⊤

tactic: rw [show (x (g ≫ f') _).1 = _ from congr_arg Subtype.val (hx f' g hf')]
state_before: case a.intro.intro.intro.intro.intro
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
Z : C
u : Z ⟶ Y
W : C
g : Z ⟶ W
f' : W ⟶ X
hf' : S.arrows f'
hg : (↑(x f' hf')).arrows g
c : g ≫ f' = u ≫ f
⊢ ↑(x (g ≫ f') (_ : S.arrows (g ≫ f'))) = ⊤

tactic: apply Sieve.pullback_eq_top_of_mem _ hg
state_before: case a.intro.intro.intro.intro.intro
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
Z : C
u : Z ⟶ Y
W : C
g : Z ⟶ W
f' : W ⟶ X
hf' : S.arrows f'
hg : (↑(x f' hf')).arrows g
c : g ≫ f' = u ≫ f
⊢ ↑((Functor.closedSieves J₁).map g.op (x f' hf')) = ⊤

tactic: apply Sieve.le_pullback_bind S fun Y f hf => (x f hf).1
state_before: case a
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ ↑(x f hf) ≤ Sieve.pullback f M

tactic: intro Y f hf
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
⊢ Presieve.FamilyOfElements.IsAmalgamation x
    { val := GrothendieckTopology.close J₁ M,
      property := (_ : GrothendieckTopology.IsClosed J₁ (GrothendieckTopology.close J₁ M)) }

tactic: simp only [Functor.closedSieves_obj]
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ (Functor.closedSieves J₁).map f.op
      { val := GrothendieckTopology.close J₁ M,
        property := (_ : GrothendieckTopology.IsClosed J₁ (GrothendieckTopology.close J₁ M)) } =
    x f hf

tactic: ext1
state_before: case refine'_2
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ (Functor.closedSieves J₁).map f.op
      { val := GrothendieckTopology.close J₁ (Sieve.bind S.arrows fun Y f hf => ↑(x f hf)),
        property := (_ : GrothendieckTopology.IsClosed J₁ (GrothendieckTopology.close J₁ M)) } =
    x f hf

tactic: dsimp
state_before: case refine'_2.a
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ ↑((Functor.closedSieves J₁).map f.op
        { val := GrothendieckTopology.close J₁ (Sieve.bind S.arrows fun Y f hf => ↑(x f hf)),
          property := (_ : GrothendieckTopology.IsClosed J₁ (GrothendieckTopology.close J₁ M)) }) =
    ↑(x f hf)

tactic: rw [← J₁.pullback_close, this _ hf]
state_before: case refine'_2.a
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ Sieve.pullback f (GrothendieckTopology.close J₁ (Sieve.bind S.arrows fun Y f hf => ↑(x f hf))) = ↑(x f hf)

tactic: apply le_antisymm (J₁.le_close_of_isClosed le_rfl (x f hf).2) (J₁.le_close _)
state_before: case refine'_2.a
C : Type u
inst✝ : Category C
J₁ J₂ : GrothendieckTopology C
X : C
S : Sieve X
hS : S ∈ GrothendieckTopology.sieves J₁ X
x : Presieve.FamilyOfElements (Functor.closedSieves J₁) S.arrows
hx : Presieve.FamilyOfElements.SieveCompatible x
M : Sieve X := Sieve.bind S.arrows fun Y f hf => ↑(x f hf)
this : ∀ ⦃Y : C⦄ (f : Y ⟶ X) (hf : S.arrows f), Sieve.pullback f M = ↑(x f hf)
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ GrothendieckTopology.close J₁ ↑(x f hf) = ↑(x f hf)