Theorem: CategoryTheory.Equalizer.Sieve.equalizer_sheaf_condition
File: Mathlib/CategoryTheory/Sites/SheafOfTypes.lean

tactic: rw [Types.type_equalizer_iff_unique,
  ← Equiv.forall_congr_left (firstObjEqFamily P (S : Presieve X)).toEquiv.symm]
state_before: C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
⊢ Presieve.IsSheafFor P S.arrows ↔
    Nonempty
      (IsLimit
        (Fork.ofι (forkMap P S.arrows) (_ : forkMap P S.arrows ≫ firstMap P S = forkMap P S.arrows ≫ secondMap P S)))

tactic: simp_rw [← compatible_iff]
state_before: C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
⊢ Presieve.IsSheafFor P S.arrows ↔
    ∀ (x : Presieve.FamilyOfElements P S.arrows),
      firstMap P S (↑(firstObjEqFamily P S.arrows).symm x) = secondMap P S (↑(firstObjEqFamily P S.arrows).symm x) →
        ∃! x_1, forkMap P S.arrows x_1 = ↑(firstObjEqFamily P S.arrows).symm x

tactic: simp only [inv_hom_id_apply, Iso.toEquiv_symm_fun]
state_before: C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
⊢ Presieve.IsSheafFor P S.arrows ↔
    ∀ (x : Presieve.FamilyOfElements P S.arrows),
      Presieve.FamilyOfElements.Compatible ((firstObjEqFamily P S.arrows).hom (↑(firstObjEqFamily P S.arrows).symm x)) →
        ∃! x_1, forkMap P S.arrows x_1 = ↑(firstObjEqFamily P S.arrows).symm x

tactic: apply ball_congr
state_before: C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
⊢ Presieve.IsSheafFor P S.arrows ↔
    ∀ (x : Presieve.FamilyOfElements P S.arrows),
      Presieve.FamilyOfElements.Compatible x → ∃! x_1, forkMap P S.arrows x_1 = (firstObjEqFamily P S.arrows).inv x

tactic: intro x _
state_before: case H
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
⊢ ∀ (x : Presieve.FamilyOfElements P S.arrows),
    Presieve.FamilyOfElements.Compatible x →
      ((∃! t, Presieve.FamilyOfElements.IsAmalgamation x t) ↔
        ∃! x_1, forkMap P S.arrows x_1 = (firstObjEqFamily P S.arrows).inv x)

tactic: apply exists_unique_congr
state_before: case H
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
⊢ (∃! t, Presieve.FamilyOfElements.IsAmalgamation x t) ↔
    ∃! x_1, forkMap P S.arrows x_1 = (firstObjEqFamily P S.arrows).inv x

tactic: intro t
state_before: case H.h
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
⊢ ∀ (a : P.obj X.op),
    Presieve.FamilyOfElements.IsAmalgamation x a ↔ forkMap P S.arrows a = (firstObjEqFamily P S.arrows).inv x

tactic: rw [← Iso.toEquiv_symm_fun]
state_before: case H.h
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ Presieve.FamilyOfElements.IsAmalgamation x t ↔ forkMap P S.arrows t = (firstObjEqFamily P S.arrows).inv x

tactic: rw [Equiv.eq_symm_apply]
state_before: case H.h
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ Presieve.FamilyOfElements.IsAmalgamation x t ↔ forkMap P S.arrows t = ↑(firstObjEqFamily P S.arrows).symm x

tactic: constructor
state_before: case H.h
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ Presieve.FamilyOfElements.IsAmalgamation x t ↔ ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x

tactic: . intro q
  funext Y f hf
  simpa [firstObjEqFamily, forkMap] using q _ _
state_before: case H.h.mp
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ Presieve.FamilyOfElements.IsAmalgamation x t → ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x

case H.h.mpr
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x → Presieve.FamilyOfElements.IsAmalgamation x t

tactic: intro q
state_before: case H.h.mp
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ Presieve.FamilyOfElements.IsAmalgamation x t → ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x

tactic: funext Y f hf
state_before: case H.h.mp
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
q : Presieve.FamilyOfElements.IsAmalgamation x t
⊢ ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x

tactic: simpa [firstObjEqFamily, forkMap] using q _ _
state_before: case H.h.mp.h.h.h
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
q : Presieve.FamilyOfElements.IsAmalgamation x t
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) f hf = x f hf

tactic: intro q Y f hf
state_before: case H.h.mpr
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
⊢ ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x → Presieve.FamilyOfElements.IsAmalgamation x t

tactic: rw [← q]
state_before: case H.h.mpr
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
q : ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ P.map f.op t = x f hf

tactic: simp [firstObjEqFamily, forkMap]
state_before: case H.h.mpr
C : Type u₁
inst✝ : Category C
P : Cᵒᵖ ⥤ Type (max v₁ u₁)
X : C
R : Presieve X
S : Sieve X
x : Presieve.FamilyOfElements P S.arrows
h✝ : Presieve.FamilyOfElements.Compatible x
t : P.obj X.op
q : ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) = x
Y : C
f : Y ⟶ X
hf : S.arrows f
⊢ P.map f.op t = ↑(firstObjEqFamily P S.arrows).toEquiv (forkMap P S.arrows t) f hf