l3lab/ntp-mathlib huggingface dataset:
theorem finset_inf_arrow_factors {I : Type*} {B : C} (s : Finset I) (P : I → Subobject B) (i : I)
    (m : i ∈ s) : (P i).Factors (s.inf P).arrow := by
  classical
  revert i m
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro _ ⟨⟩
  · intro _ m
    rw [Finset.inf_insert]
    simp only [Finset.mem_insert] at m
    rcases m with (rfl | m)
    · 

Proof state:
case insert.inl
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
I : Type u_1
B : C
P : I → Subobject B
s✝ : Finset I
ih : ∀ i ∈ s✝, Factors (P i) (arrow (Finset.inf s✝ P))
i✝ : I
a✝ : i✝ ∉ s✝
⊢ Factors (P i✝) (arrow (P i✝ ⊓ Finset.inf s✝ P))

Next tactic:
rw [← factorThru_arrow _ _ (inf_arrow_factors_left _ _)]
theorem finset_inf_arrow_factors {I : Type*} {B : C} (s : Finset I) (P : I → Subobject B) (i : I)
    (m : i ∈ s) : (P i).Factors (s.inf P).arrow := by
  classical
  revert i m
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro _ ⟨⟩
  · intro _ m
    rw [Finset.inf_insert]
    simp only [Finset.mem_insert] at m
    rcases m with (rfl | m)
    · rw [← factorThru_arrow _ _ (inf_arrow_factors_left _ _)]
      

Proof state:
case insert.inl
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
I : Type u_1
B : C
P : I → Subobject B
s✝ : Finset I
ih : ∀ i ∈ s✝, Factors (P i) (arrow (Finset.inf s✝ P))
i✝ : I
a✝ : i✝ ∉ s✝
⊢ Factors (P i✝)
    (factorThru (P i✝) (arrow (P i✝ ⊓ Finset.inf s✝ P)) (_ : Factors (P i✝) (arrow (P i✝ ⊓ Finset.inf s✝ P))) ≫
      arrow (P i✝))

Next tactic:
exact factors_comp_arrow _
theorem finset_inf_arrow_factors {I : Type*} {B : C} (s : Finset I) (P : I → Subobject B) (i : I)
    (m : i ∈ s) : (P i).Factors (s.inf P).arrow := by
  classical
  revert i m
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro _ ⟨⟩
  · intro _ m
    rw [Finset.inf_insert]
    simp only [Finset.mem_insert] at m
    rcases m with (rfl | m)
    · rw [← factorThru_arrow _ _ (inf_arrow_factors_left _ _)]
      exact factors_comp_arrow _
    · 

Proof state:
case insert.inr
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
I : Type u_1
B : C
P : I → Subobject B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : ∀ i ∈ s✝, Factors (P i) (arrow (Finset.inf s✝ P))
i✝ : I
m : i✝ ∈ s✝
⊢ Factors (P i✝) (arrow (P a✝¹ ⊓ Finset.inf s✝ P))

Next tactic:
rw [← factorThru_arrow _ _ (inf_arrow_factors_right _ _)]
theorem finset_inf_arrow_factors {I : Type*} {B : C} (s : Finset I) (P : I → Subobject B) (i : I)
    (m : i ∈ s) : (P i).Factors (s.inf P).arrow := by
  classical
  revert i m
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro _ ⟨⟩
  · intro _ m
    rw [Finset.inf_insert]
    simp only [Finset.mem_insert] at m
    rcases m with (rfl | m)
    · rw [← factorThru_arrow _ _ (inf_arrow_factors_left _ _)]
      exact factors_comp_arrow _
    · rw [← factorThru_arrow _ _ (inf_arrow_factors_right _ _)]
      

Proof state:
case insert.inr
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
I : Type u_1
B : C
P : I → Subobject B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : ∀ i ∈ s✝, Factors (P i) (arrow (Finset.inf s✝ P))
i✝ : I
m : i✝ ∈ s✝
⊢ Factors (P i✝)
    (factorThru (Finset.inf s✝ P) (arrow (P a✝¹ ⊓ Finset.inf s✝ P))
        (_ : Factors (Finset.inf s✝ P) (arrow (P a✝¹ ⊓ Finset.inf s✝ P))) ≫
      arrow (Finset.inf s✝ P))

Next tactic:
apply factors_of_factors_right
theorem finset_inf_arrow_factors {I : Type*} {B : C} (s : Finset I) (P : I → Subobject B) (i : I)
    (m : i ∈ s) : (P i).Factors (s.inf P).arrow := by
  classical
  revert i m
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro _ ⟨⟩
  · intro _ m
    rw [Finset.inf_insert]
    simp only [Finset.mem_insert] at m
    rcases m with (rfl | m)
    · rw [← factorThru_arrow _ _ (inf_arrow_factors_left _ _)]
      exact factors_comp_arrow _
    · rw [← factorThru_arrow _ _ (inf_arrow_factors_right _ _)]
      apply factors_of_factors_right
      

Proof state:
case insert.inr.h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
I : Type u_1
B : C
P : I → Subobject B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : ∀ i ∈ s✝, Factors (P i) (arrow (Finset.inf s✝ P))
i✝ : I
m : i✝ ∈ s✝
⊢ Factors (P i✝) (arrow (Finset.inf s✝ P))

Next tactic:
exact ih _ m
theorem inf_eq_map_pullback' {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) :
    (Subobject.inf.obj (Quotient.mk'' f₁)).obj f₂ =
      (Subobject.map f₁.arrow).obj ((Subobject.pullback f₁.arrow).obj f₂) := by
  

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
A : C
f₁ : MonoOver A
f₂ : Subobject A
⊢ (inf.obj (Quotient.mk'' f₁)).obj f₂ = (map (MonoOver.arrow f₁)).obj ((pullback (MonoOver.arrow f₁)).obj f₂)

Next tactic:
induction' f₂ using Quotient.inductionOn' with f₂
theorem inf_eq_map_pullback' {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) :
    (Subobject.inf.obj (Quotient.mk'' f₁)).obj f₂ =
      (Subobject.map f₁.arrow).obj ((Subobject.pullback f₁.arrow).obj f₂) := by
  induction' f₂ using Quotient.inductionOn' with f₂
  

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
A : C
f₁ f₂ : MonoOver A
⊢ (inf.obj (Quotient.mk'' f₁)).obj (Quotient.mk'' f₂) =
    (map (MonoOver.arrow f₁)).obj ((pullback (MonoOver.arrow f₁)).obj (Quotient.mk'' f₂))

Next tactic:
rfl
theorem prod_eq_inf {A : C} {f₁ f₂ : Subobject A} [HasBinaryProduct f₁ f₂] :
    (f₁ ⨯ f₂) = f₁ ⊓ f₂ := by
  

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
A : C
f₁ f₂ : Subobject A
inst✝ : HasBinaryProduct f₁ f₂
⊢ (f₁ ⨯ f₂) = f₁ ⊓ f₂

Next tactic:
apply le_antisymm
theorem prod_eq_inf {A : C} {f₁ f₂ : Subobject A} [HasBinaryProduct f₁ f₂] :
    (f₁ ⨯ f₂) = f₁ ⊓ f₂ := by
  apply le_antisymm
  · 

Proof state:
case a
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
A : C
f₁ f₂ : Subobject A
inst✝ : HasBinaryProduct f₁ f₂
⊢ (f₁ ⨯ f₂) ≤ f₁ ⊓ f₂

Next tactic:
refine' le_inf _ _ _ (Limits.prod.fst.le) (Limits.prod.snd.le)
theorem prod_eq_inf {A : C} {f₁ f₂ : Subobject A} [HasBinaryProduct f₁ f₂] :
    (f₁ ⨯ f₂) = f₁ ⊓ f₂ := by
  apply le_antisymm
  · refine' le_inf _ _ _ (Limits.prod.fst.le) (Limits.prod.snd.le)
  · 

Proof state:
case a
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
A : C
f₁ f₂ : Subobject A
inst✝ : HasBinaryProduct f₁ f₂
⊢ f₁ ⊓ f₂ ≤ (f₁ ⨯ f₂)

Next tactic:
apply leOfHom
theorem prod_eq_inf {A : C} {f₁ f₂ : Subobject A} [HasBinaryProduct f₁ f₂] :
    (f₁ ⨯ f₂) = f₁ ⊓ f₂ := by
  apply le_antisymm
  · refine' le_inf _ _ _ (Limits.prod.fst.le) (Limits.prod.snd.le)
  · apply leOfHom
    

Proof state:
case a.h
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
A : C
f₁ f₂ : Subobject A
inst✝ : HasBinaryProduct f₁ f₂
⊢ f₁ ⊓ f₂ ⟶ f₁ ⨯ f₂

Next tactic:
exact prod.lift (inf_le_left _ _).hom (inf_le_right _ _).hom
/-- `⊓` commutes with pullback. -/
theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) :
    (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂ := by
  

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
X Y : C
g : X ⟶ Y
f₁ f₂ : Subobject Y
⊢ (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂

Next tactic:
revert f₁
/-- `⊓` commutes with pullback. -/
theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) :
    (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂ := by
  revert f₁
  

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
X Y : C
g : X ⟶ Y
f₂ : Subobject Y
⊢ ∀ (f₁ : Subobject Y), (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂

Next tactic:
apply Quotient.ind'
/-- `⊓` commutes with pullback. -/
theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) :
    (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
X Y : C
g : X ⟶ Y
f₂ : Subobject Y
⊢ ∀ (a : MonoOver Y), (pullback g).obj (Quotient.mk'' a ⊓ f₂) = (pullback g).obj (Quotient.mk'' a) ⊓ (pullback g).obj f₂

Next tactic:
intro f₁
/-- `⊓` commutes with pullback. -/
theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) :
    (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  intro f₁
  

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
X Y : C
g : X ⟶ Y
f₂ : Subobject Y
f₁ : MonoOver Y
⊢ (pullback g).obj (Quotient.mk'' f₁ ⊓ f₂) = (pullback g).obj (Quotient.mk'' f₁) ⊓ (pullback g).obj f₂

Next tactic:
erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← pullback_comp, ←
    map_pullback pullback.condition (pullbackIsPullback f₁.arrow g), ← pullback_comp,
    pullback.condition]
/-- `⊓` commutes with pullback. -/
theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) :
    (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  intro f₁
  erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← pullback_comp, ←
    map_pullback pullback.condition (pullbackIsPullback f₁.arrow g), ← pullback_comp,
    pullback.condition]
  

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : HasPullbacks C
X Y : C
g : X ⟶ Y
f₂ : Subobject Y
f₁ : MonoOver Y
⊢ (map pullback.snd).obj ((pullback (pullback.snd ≫ g)).obj f₂) =
    (map (MonoOver.arrow ((MonoOver.pullback g).obj f₁))).obj
      ((pullback (MonoOver.arrow ((MonoOver.pullback g).obj f₁) ≫ g)).obj f₂)

Next tactic:
rfl
/-- `⊓` commutes with map. -/
theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) :
    (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by
  

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
X Y : C
g : Y ⟶ X
inst✝ : Mono g
f₁ f₂ : Subobject Y
⊢ (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂

Next tactic:
revert f₁
/-- `⊓` commutes with map. -/
theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) :
    (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by
  revert f₁
  

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
X Y : C
g : Y ⟶ X
inst✝ : Mono g
f₂ : Subobject Y
⊢ ∀ (f₁ : Subobject Y), (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂

Next tactic:
apply Quotient.ind'
/-- `⊓` commutes with map. -/
theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) :
    (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  

Proof state:
case h
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
X Y : C
g : Y ⟶ X
inst✝ : Mono g
f₂ : Subobject Y
⊢ ∀ (a : MonoOver Y), (map g).obj (Quotient.mk'' a ⊓ f₂) = (map g).obj (Quotient.mk'' a) ⊓ (map g).obj f₂

Next tactic:
intro f₁
/-- `⊓` commutes with map. -/
theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) :
    (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  intro f₁
  

Proof state:
case h
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
X Y : C
g : Y ⟶ X
inst✝ : Mono g
f₂ : Subobject Y
f₁ : MonoOver Y
⊢ (map g).obj (Quotient.mk'' f₁ ⊓ f₂) = (map g).obj (Quotient.mk'' f₁) ⊓ (map g).obj f₂

Next tactic:
erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← map_comp]
/-- `⊓` commutes with map. -/
theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) :
    (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  intro f₁
  erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← map_comp]
  

Proof state:
case h
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
X Y : C
g : Y ⟶ X
inst✝ : Mono g
f₂ : Subobject Y
f₁ : MonoOver Y
⊢ (map (MonoOver.arrow f₁ ≫ g)).obj ((pullback (MonoOver.arrow f₁)).obj f₂) =
    (map (MonoOver.arrow ((MonoOver.map g).obj f₁))).obj
      ((pullback (MonoOver.arrow ((MonoOver.map g).obj f₁))).obj ((map g).obj f₂))

Next tactic:
dsimp
/-- `⊓` commutes with map. -/
theorem inf_map {X Y : C} (g : Y ⟶ X) [Mono g] (f₁ f₂) :
    (map g).obj (f₁ ⊓ f₂) = (map g).obj f₁ ⊓ (map g).obj f₂ := by
  revert f₁
  apply Quotient.ind'
  intro f₁
  erw [inf_def, inf_def, inf_eq_map_pullback', inf_eq_map_pullback', ← map_comp]
  dsimp
  

Proof state:
case h
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X✝ Y✝ Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : HasPullbacks C
X Y : C
g : Y ⟶ X
inst✝ : Mono g
f₂ : Subobject Y
f₁ : MonoOver Y
⊢ (map (MonoOver.arrow f₁ ≫ g)).obj ((pullback (MonoOver.arrow f₁)).obj f₂) =
    (map (MonoOver.arrow f₁ ≫ g)).obj ((pullback (MonoOver.arrow f₁ ≫ g)).obj ((map g).obj f₂))

Next tactic:
rw [pullback_comp, pullback_map_self]
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
s : Finset I
P : I → Subobject B
f : A ⟶ B
h : ∃ i ∈ s, Factors (P i) f
⊢ Factors (Finset.sup s P) f

Next tactic:
classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · rintro ⟨j, ⟨m, h⟩⟩
    simp only [Finset.sup_insert]
    simp at m
    rcases m with (rfl | m)
    · exact sup_factors_of_factors_left h
    · exact sup_factors_of_factors_right (ih ⟨j, ⟨m, h⟩⟩)
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
s : Finset I
P : I → Subobject B
f : A ⟶ B
h : ∃ i ∈ s, Factors (P i) f
⊢ Factors (Finset.sup s P) f

Next tactic:
revert h
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
s : Finset I
P : I → Subobject B
f : A ⟶ B
⊢ (∃ i ∈ s, Factors (P i) f) → Factors (Finset.sup s P) f

Next tactic:
induction' s using Finset.induction_on with _ _ _ ih
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · 

Proof state:
case empty
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
⊢ (∃ i ∈ ∅, Factors (P i) f) → Factors (Finset.sup ∅ P) f

Next tactic:
rintro ⟨_, ⟨⟨⟩, _⟩⟩
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · 

Proof state:
case insert
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : (∃ i ∈ s✝, Factors (P i) f) → Factors (Finset.sup s✝ P) f
⊢ (∃ i ∈ insert a✝¹ s✝, Factors (P i) f) → Factors (Finset.sup (insert a✝¹ s✝) P) f

Next tactic:
rintro ⟨j, ⟨m, h⟩⟩
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · rintro ⟨j, ⟨m, h⟩⟩
    

Proof state:
case insert.intro.intro
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : (∃ i ∈ s✝, Factors (P i) f) → Factors (Finset.sup s✝ P) f
j : I
m : j ∈ insert a✝¹ s✝
h : Factors (P j) f
⊢ Factors (Finset.sup (insert a✝¹ s✝) P) f

Next tactic:
simp only [Finset.sup_insert]
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · rintro ⟨j, ⟨m, h⟩⟩
    simp only [Finset.sup_insert]
    

Proof state:
case insert.intro.intro
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : (∃ i ∈ s✝, Factors (P i) f) → Factors (Finset.sup s✝ P) f
j : I
m : j ∈ insert a✝¹ s✝
h : Factors (P j) f
⊢ Factors (P a✝¹ ⊔ Finset.sup s✝ P) f

Next tactic:
simp at m
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · rintro ⟨j, ⟨m, h⟩⟩
    simp only [Finset.sup_insert]
    simp at m
    

Proof state:
case insert.intro.intro
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : (∃ i ∈ s✝, Factors (P i) f) → Factors (Finset.sup s✝ P) f
j : I
h : Factors (P j) f
m : j = a✝¹ ∨ j ∈ s✝
⊢ Factors (P a✝¹ ⊔ Finset.sup s✝ P) f

Next tactic:
rcases m with (rfl | m)
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · rintro ⟨j, ⟨m, h⟩⟩
    simp only [Finset.sup_insert]
    simp at m
    rcases m with (rfl | m)
    · 

Proof state:
case insert.intro.intro.inl
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
s✝ : Finset I
ih : (∃ i ∈ s✝, Factors (P i) f) → Factors (Finset.sup s✝ P) f
j : I
h : Factors (P j) f
a✝ : j ∉ s✝
⊢ Factors (P j ⊔ Finset.sup s✝ P) f

Next tactic:
exact sup_factors_of_factors_left h
theorem finset_sup_factors {I : Type*} {A B : C} {s : Finset I} {P : I → Subobject B} {f : A ⟶ B}
    (h : ∃ i ∈ s, (P i).Factors f) : (s.sup P).Factors f := by
  classical
  revert h
  induction' s using Finset.induction_on with _ _ _ ih
  · rintro ⟨_, ⟨⟨⟩, _⟩⟩
  · rintro ⟨j, ⟨m, h⟩⟩
    simp only [Finset.sup_insert]
    simp at m
    rcases m with (rfl | m)
    · exact sup_factors_of_factors_left h
    · 

Proof state:
case insert.intro.intro.inr
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : HasImages C
inst✝² : HasBinaryCoproducts C
inst✝¹ : HasInitial C
inst✝ : InitialMonoClass C
I : Type u_1
A B : C
P : I → Subobject B
f : A ⟶ B
a✝¹ : I
s✝ : Finset I
a✝ : a✝¹ ∉ s✝
ih : (∃ i ∈ s✝, Factors (P i) f) → Factors (Finset.sup s✝ P) f
j : I
h : Factors (P j) f
m : j ∈ s✝
⊢ Factors (P a✝¹ ⊔ Finset.sup s✝ P) f

Next tactic:
exact sup_factors_of_factors_right (ih ⟨j, ⟨m, h⟩⟩)
/-- Auxiliary construction of a cone for `le_inf`. -/
def leInfCone {A : C} (s : Set (Subobject A)) (f : Subobject A) (k : ∀ g ∈ s, f ≤ g) :
    Cone (wideCospan s) :=
  WidePullbackShape.mkCone f.arrow
    (fun j =>
      underlying.map
        (homOfLE
          (k _
            (by
              

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : WellPowered C
A : C
s : Set (Subobject A)
f : Subobject A
k : ∀ g ∈ s, f ≤ g
j : ↑(⇑(equivShrink (Subobject A)) '' s)
⊢ (equivShrink (Subobject A)).symm ↑j ∈ s

Next tactic:
rcases j with ⟨-, ⟨g, ⟨m, rfl⟩⟩⟩
/-- Auxiliary construction of a cone for `le_inf`. -/
def leInfCone {A : C} (s : Set (Subobject A)) (f : Subobject A) (k : ∀ g ∈ s, f ≤ g) :
    Cone (wideCospan s) :=
  WidePullbackShape.mkCone f.arrow
    (fun j =>
      underlying.map
        (homOfLE
          (k _
            (by
              rcases j with ⟨-, ⟨g, ⟨m, rfl⟩⟩⟩
              

Proof state:
case mk.intro.intro
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : WellPowered C
A : C
s : Set (Subobject A)
f : Subobject A
k : ∀ g ∈ s, f ≤ g
g : Subobject A
m : g ∈ s
⊢ (equivShrink (Subobject A)).symm
      ↑{ val := (equivShrink (Subobject A)) g,
          property := (_ : ∃ a ∈ s, (equivShrink (Subobject A)) a = (equivShrink (Subobject A)) g) } ∈
    s

Next tactic:
simpa using m
/-- Auxiliary construction of a cone for `le_inf`. -/
def leInfCone {A : C} (s : Set (Subobject A)) (f : Subobject A) (k : ∀ g ∈ s, f ≤ g) :
    Cone (wideCospan s) :=
  WidePullbackShape.mkCone f.arrow
    (fun j =>
      underlying.map
        (homOfLE
          (k _
            (by
              rcases j with ⟨-, ⟨g, ⟨m, rfl⟩⟩⟩
              simpa using m))))
    (by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : WellPowered C
A : C
s : Set (Subobject A)
f : Subobject A
k : ∀ g ∈ s, f ≤ g
⊢ ∀ (j : ↑(⇑(equivShrink (Subobject A)) '' s)),
    (fun j => underlying.map (homOfLE (_ : f ≤ (equivShrink (Subobject A)).symm ↑j))) j ≫
        (wideCospan s).map (WidePullbackShape.Hom.term j) =
      arrow f

Next tactic:
aesop_cat
instance widePullbackι_mono {A : C} (s : Set (Subobject A)) : Mono (widePullbackι s) :=
  ⟨fun u v h =>
    limit.hom_ext fun j => by
      

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
X Y Z : C
D : Type u₂
inst✝² : Category.{v₂, u₂} D
inst✝¹ : WellPowered C
inst✝ : HasWidePullbacks C
A : C
s : Set (Subobject A)
Z✝ : C
u v : Z✝ ⟶ widePullback s
h : u ≫ widePullbackι s = v ≫ widePullbackι s
j : WidePullbackShape ↑(⇑(equivShrink (Subobject A)) '' s)
⊢ u ≫ limit.π (wideCospan s) j = v ≫ limit.π (wideCospan s) j

Next tactic:
cases j