l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem adjoin_range_ι : Algebra.adjoin R (Set.range (ι R : X → FreeAlgebra R X)) = ⊤ := by
  set S := Algebra.adjoin R (Set.range (ι R : X → FreeAlgebra R X))
  refine top_unique fun x hx => ?_; clear hx
  induction x using FreeAlgebra.induction with
  | h_grade0 => exact S.algebraMap_mem _
  | h_add x y hx hy => exact S.add_mem hx hy
  | h_mul x y hx hy => exact S.mul_mem hx hy
  | h_grade1 x => 

Proof state:
case h_grade1
R : Type u_1
inst✝ : CommSemiring R
X : Type u_2
S : Subalgebra R (FreeAlgebra R X) := Algebra.adjoin R (Set.range (ι R))
x : X
⊢ ι R x ∈ S

Next tactic:
exact Algebra.subset_adjoin (Set.mem_range_self _)
/-- Noncommutative version of `Algebra.adjoin_range_eq_range_aeval`. -/
theorem _root_.Algebra.adjoin_range_eq_range_freeAlgebra_lift (f : X → A) :
    Algebra.adjoin R (Set.range f) = (FreeAlgebra.lift R f).range := by
  

Proof state:
R : Type u_1
inst✝² : CommSemiring R
X : Type u_2
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
f : X → A
⊢ Algebra.adjoin R (Set.range f) = AlgHom.range ((lift R) f)

Next tactic:
simp only [← Algebra.map_top, ← adjoin_range_ι, AlgHom.map_adjoin, ← Set.range_comp,
    (· ∘ ·), lift_ι_apply]
/-- Noncommutative version of `Algebra.adjoin_range_eq_range`. -/
theorem _root_.Algebra.adjoin_eq_range_freeAlgebra_lift (s : Set A) :
    Algebra.adjoin R s = (FreeAlgebra.lift R ((↑) : s → A)).range := by
  

Proof state:
R : Type u_1
inst✝² : CommSemiring R
X : Type u_2
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
s : Set A
⊢ Algebra.adjoin R s = AlgHom.range ((lift R) Subtype.val)

Next tactic:
rw [← Algebra.adjoin_range_eq_range_freeAlgebra_lift, Subtype.range_coe]
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
⊢ RepresentablyFlat (𝟭 C)

Next tactic:
constructor
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  

Proof state:
case cofiltered
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
⊢ ∀ (X : C), IsCofiltered (StructuredArrow X (𝟭 C))

Next tactic:
intro X
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  

Proof state:
case cofiltered
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
⊢ IsCofiltered (StructuredArrow X (𝟭 C))

Next tactic:
haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  

Proof state:
case cofiltered
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
⊢ IsCofiltered (StructuredArrow X (𝟭 C))

Next tactic:
suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · 

Proof state:
case cofiltered
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this✝ : Nonempty (StructuredArrow X (𝟭 C))
this : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
⊢ IsCofiltered (StructuredArrow X (𝟭 C))

Next tactic:
constructor
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  

Proof state:
case this
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
⊢ IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))

Next tactic:
constructor
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · 

Proof state:
case this.cone_objs
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
⊢ ∀ (X_1 Y : StructuredArrow X (𝟭 C)), ∃ W x x, True

Next tactic:
intro Y Z
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    

Proof state:
case this.cone_objs
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
⊢ ∃ W x x, True

Next tactic:
use StructuredArrow.mk (𝟙 _)
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
⊢ ∃ x x, True

Next tactic:
use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
⊢ (StructuredArrow.mk (𝟙 X)).hom ≫ (𝟭 C).map Y.hom = Y.hom

Next tactic:
erw [Functor.id_map, Category.id_comp]
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
⊢ ∃ x, True

Next tactic:
use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
⊢ (StructuredArrow.mk (𝟙 X)).hom ≫ (𝟭 C).map Z.hom = Z.hom

Next tactic:
erw [Functor.id_map, Category.id_comp]
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · 

Proof state:
case this.cone_maps
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
⊢ ∀ ⦃X_1 Y : StructuredArrow X (𝟭 C)⦄ (f g : X_1 ⟶ Y), ∃ W h, h ≫ f = h ≫ g

Next tactic:
intro Y Z f g
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    

Proof state:
case this.cone_maps
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ ∃ W h, h ≫ f = h ≫ g

Next tactic:
use StructuredArrow.mk (𝟙 _)
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    use StructuredArrow.mk (𝟙 _)
    

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ ∃ h, h ≫ f = h ≫ g

Next tactic:
use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ (StructuredArrow.mk (𝟙 X)).hom ≫ (𝟭 C).map Y.hom = Y.hom

Next tactic:
erw [Functor.id_map, Category.id_comp]
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ StructuredArrow.homMk Y.hom ≫ f = StructuredArrow.homMk Y.hom ≫ g

Next tactic:
ext
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    ext
    

Proof state:
case h.h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ (StructuredArrow.homMk Y.hom ≫ f).right = (StructuredArrow.homMk Y.hom ≫ g).right

Next tactic:
trans Z.hom
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    ext
    trans Z.hom <;> 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ (StructuredArrow.homMk Y.hom ≫ f).right = Z.hom

Next tactic:
simp
instance RepresentablyFlat.id : RepresentablyFlat (𝟭 C) := by
  constructor
  intro X
  haveI : Nonempty (StructuredArrow X (𝟭 C)) := ⟨StructuredArrow.mk (𝟙 _)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (𝟭 C))
  · constructor
  constructor
  · intro Y Z
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    use StructuredArrow.homMk Z.hom (by erw [Functor.id_map, Category.id_comp])
  · intro Y Z f g
    use StructuredArrow.mk (𝟙 _)
    use StructuredArrow.homMk Y.hom (by erw [Functor.id_map, Category.id_comp])
    ext
    trans Z.hom <;> 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
E : Type u₃
inst✝ : Category.{v₃, u₃} E
X : C
this : Nonempty (StructuredArrow X (𝟭 C))
Y Z : StructuredArrow X (𝟭 C)
f g : Y ⟶ Z
⊢ Z.hom = (StructuredArrow.homMk Y.hom ≫ g).right

Next tactic:
simp
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  

Proof state:
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
⊢ RepresentablyFlat (F ⋙ G)

Next tactic:
constructor
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  

Proof state:
case cofiltered
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
⊢ ∀ (X : E), IsCofiltered (StructuredArrow X (F ⋙ G))

Next tactic:
intro X
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  

Proof state:
case cofiltered
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
⊢ IsCofiltered (StructuredArrow X (F ⋙ G))

Next tactic:
have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    

Proof state:
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
⊢ Nonempty (StructuredArrow X (F ⋙ G))

Next tactic:
have f₁ : StructuredArrow X G := Nonempty.some inferInstance
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    

Proof state:
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
f₁ : StructuredArrow X G
⊢ Nonempty (StructuredArrow X (F ⋙ G))

Next tactic:
have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    

Proof state:
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
f₁ : StructuredArrow X G
f₂ : StructuredArrow f₁.right F
⊢ Nonempty (StructuredArrow X (F ⋙ G))

Next tactic:
exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  

Proof state:
case cofiltered
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this : Nonempty (StructuredArrow X (F ⋙ G))
⊢ IsCofiltered (StructuredArrow X (F ⋙ G))

Next tactic:
suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
  · 

Proof state:
case cofiltered
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this✝ : Nonempty (StructuredArrow X (F ⋙ G))
this : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
⊢ IsCofiltered (StructuredArrow X (F ⋙ G))

Next tactic:
constructor
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
  · constructor
  

Proof state:
case this
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this : Nonempty (StructuredArrow X (F ⋙ G))
⊢ IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))

Next tactic:
constructor
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
  · constructor
  constructor
  · 

Proof state:
case this.cone_objs
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this : Nonempty (StructuredArrow X (F ⋙ G))
⊢ ∀ (X_1 Y : StructuredArrow X (F ⋙ G)), ∃ W x x, True

Next tactic:
intro Y Z
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
  · constructor
  constructor
  · intro Y Z
    

Proof state:
case this.cone_objs
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this : Nonempty (StructuredArrow X (F ⋙ G))
Y Z : StructuredArrow X (F ⋙ G)
⊢ ∃ W x x, True

Next tactic:
let W :=
      @IsCofiltered.min (StructuredArrow X G) _ _ (StructuredArrow.mk Y.hom)
        (StructuredArrow.mk Z.hom)
instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
  · constructor
  constructor
  · intro Y Z
    let W :=
      @IsCofiltered.min (StructuredArrow X G) _ _ (StructuredArrow.mk Y.hom)
        (StructuredArrow.mk Z.hom)
    

Proof state:
case this.cone_objs
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this : Nonempty (StructuredArrow X (F ⋙ G))
Y Z : StructuredArrow X (F ⋙ G)
W : StructuredArrow X G := IsCofiltered.min (StructuredArrow.mk Y.hom) (StructuredArrow.mk Z.hom)
⊢ ∃ W x x, True

Next tactic:
let Y' : W ⟶ _ := IsCofiltered.minToLeft _ _