l3lab/ntp-mathlib huggingface dataset:
/--
Implementation: If `π` is a surjective morphism in `Stonean`, then it is an effective epi.
The theorem `Stonean.effectiveEpi_tfae` should be used instead.
-/
noncomputable
def struct {B X : Stonean.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where
  desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦
    FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a
  fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e
    fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a)
  uniq e h g hm := by
    suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e,
      fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
      (by ext; exact hab)) a⟩ by assumption
    

Proof state:
B X : Stonean
π : X ⟶ B
hπ : Function.Surjective ⇑π
W✝ : Stonean
e : X ⟶ W✝
h : ∀ {Z : Stonean} (g₁ g₂ : Z ⟶ X), g₁ ≫ π = g₂ ≫ π → g₁ ≫ e = g₂ ≫ e
g : B ⟶ W✝
hm : π ≫ g = e
⊢ g =
    (QuotientMap.liftEquiv (_ : QuotientMap ⇑π))
      { val := e,
        property :=
          (_ :
            ∀ (a b : CoeSort.coe X),
              π a = π b → ((ContinuousMap.mk fun x => a) ≫ e) a = ((ContinuousMap.mk fun x => b) ≫ e) a) }

Next tactic:
rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv]
/--
Implementation: If `π` is a surjective morphism in `Stonean`, then it is an effective epi.
The theorem `Stonean.effectiveEpi_tfae` should be used instead.
-/
noncomputable
def struct {B X : Stonean.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where
  desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦
    FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a
  fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e
    fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a)
  uniq e h g hm := by
    suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e,
      fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
      (by ext; exact hab)) a⟩ by assumption
    rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv]
    

Proof state:
B X : Stonean
π : X ⟶ B
hπ : Function.Surjective ⇑π
W✝ : Stonean
e : X ⟶ W✝
h : ∀ {Z : Stonean} (g₁ g₂ : Z ⟶ X), g₁ ≫ π = g₂ ≫ π → g₁ ≫ e = g₂ ≫ e
g : B ⟶ W✝
hm : π ≫ g = e
⊢ (QuotientMap.liftEquiv (_ : QuotientMap ⇑π)).symm g =
    { val := e,
      property :=
        (_ :
          ∀ (a b : CoeSort.coe X),
            π a = π b → ((ContinuousMap.mk fun x => a) ≫ e) a = ((ContinuousMap.mk fun x => b) ≫ e) a) }

Next tactic:
ext
/--
Implementation: If `π` is a surjective morphism in `Stonean`, then it is an effective epi.
The theorem `Stonean.effectiveEpi_tfae` should be used instead.
-/
noncomputable
def struct {B X : Stonean.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where
  desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦
    FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a
  fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e
    fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a)
  uniq e h g hm := by
    suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e,
      fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
      (by ext; exact hab)) a⟩ by assumption
    rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv]
    ext
    

Proof state:
case a.h
B X : Stonean
π : X ⟶ B
hπ : Function.Surjective ⇑π
W✝ : Stonean
e : X ⟶ W✝
h : ∀ {Z : Stonean} (g₁ g₂ : Z ⟶ X), g₁ ≫ π = g₂ ≫ π → g₁ ≫ e = g₂ ≫ e
g : B ⟶ W✝
hm : π ≫ g = e
a✝ : CoeSort.coe X
⊢ ↑((QuotientMap.liftEquiv (_ : QuotientMap ⇑π)).symm g) a✝ =
    ↑{ val := e,
          property :=
            (_ :
              ∀ (a b : CoeSort.coe X),
                π a = π b → ((ContinuousMap.mk fun x => a) ≫ e) a = ((ContinuousMap.mk fun x => b) ≫ e) a) }
      a✝

Next tactic:
simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, ← hm]
/--
Implementation: If `π` is a surjective morphism in `Stonean`, then it is an effective epi.
The theorem `Stonean.effectiveEpi_tfae` should be used instead.
-/
noncomputable
def struct {B X : Stonean.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where
  desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦
    FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a
  fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e
    fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
    (by ext; exact hab)) a)
  uniq e h g hm := by
    suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e,
      fun a b hab ↦ FunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩
      (by ext; exact hab)) a⟩ by assumption
    rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv]
    ext
    simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, ← hm]
    

Proof state:
case a.h
B X : Stonean
π : X ⟶ B
hπ : Function.Surjective ⇑π
W✝ : Stonean
e : X ⟶ W✝
h : ∀ {Z : Stonean} (g₁ g₂ : Z ⟶ X), g₁ ≫ π = g₂ ≫ π → g₁ ≫ e = g₂ ≫ e
g : B ⟶ W✝
hm : π ≫ g = e
a✝ : CoeSort.coe X
⊢ g (π a✝) = (π ≫ g) a✝

Next tactic:
rfl
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  

Proof state:
B X : Stonean
π : X ⟶ B
⊢ TFAE [EffectiveEpi π, Epi π, Function.Surjective ⇑π]

Next tactic:
tfae_have 1 → 2
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · 

Proof state:
case tfae_1_to_2
B X : Stonean
π : X ⟶ B
⊢ EffectiveEpi π → Epi π

Next tactic:
intro
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · intro; 

Proof state:
case tfae_1_to_2
B X : Stonean
π : X ⟶ B
✝ : EffectiveEpi π
⊢ Epi π

Next tactic:
infer_instance
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · intro; infer_instance
  

Proof state:
B X : Stonean
π : X ⟶ B
tfae_1_to_2 : EffectiveEpi π → Epi π
⊢ TFAE [EffectiveEpi π, Epi π, Function.Surjective ⇑π]

Next tactic:
tfae_have 2 ↔ 3
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 2 ↔ 3
  · 

Proof state:
case tfae_2_iff_3
B X : Stonean
π : X ⟶ B
tfae_1_to_2 : EffectiveEpi π → Epi π
⊢ Epi π ↔ Function.Surjective ⇑π

Next tactic:
exact epi_iff_surjective π
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 2 ↔ 3
  · exact epi_iff_surjective π
  

Proof state:
B X : Stonean
π : X ⟶ B
tfae_1_to_2 : EffectiveEpi π → Epi π
tfae_2_iff_3 : Epi π ↔ Function.Surjective ⇑π
⊢ TFAE [EffectiveEpi π, Epi π, Function.Surjective ⇑π]

Next tactic:
tfae_have 3 → 1
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 2 ↔ 3
  · exact epi_iff_surjective π
  tfae_have 3 → 1
  · 

Proof state:
case tfae_3_to_1
B X : Stonean
π : X ⟶ B
tfae_1_to_2 : EffectiveEpi π → Epi π
tfae_2_iff_3 : Epi π ↔ Function.Surjective ⇑π
⊢ Function.Surjective ⇑π → EffectiveEpi π

Next tactic:
exact fun hπ ↦ ⟨⟨struct π hπ⟩⟩
open List in
theorem effectiveEpi_tfae
    {B X : Stonean.{u}} (π : X ⟶ B) :
    TFAE
    [ EffectiveEpi π
    , Epi π
    , Function.Surjective π
    ] := by
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 2 ↔ 3
  · exact epi_iff_surjective π
  tfae_have 3 → 1
  · exact fun hπ ↦ ⟨⟨struct π hπ⟩⟩
  

Proof state:
B X : Stonean
π : X ⟶ B
tfae_1_to_2 : EffectiveEpi π → Epi π
tfae_2_iff_3 : Epi π ↔ Function.Surjective ⇑π
tfae_3_to_1 : Function.Surjective ⇑π → EffectiveEpi π
⊢ TFAE [EffectiveEpi π, Epi π, Function.Surjective ⇑π]

Next tactic:
tfae_finish
instance : Preregular Stonean where
  exists_fac := by
    

Proof state:
⊢ ∀ {X Y Z : Stonean} (f : X ⟶ Y) (g : Z ⟶ Y) [inst : EffectiveEpi g], ∃ W h, ∃ (_ : EffectiveEpi h), ∃ i, i ≫ g = h ≫ f

Next tactic:
intro X Y Z f π hπ
instance : Preregular Stonean where
  exists_fac := by
    intro X Y Z f π hπ
    

Proof state:
X Y Z : Stonean
f : X ⟶ Y
π : Z ⟶ Y
hπ : EffectiveEpi π
⊢ ∃ W h, ∃ (_ : EffectiveEpi h), ∃ i, i ≫ π = h ≫ f

Next tactic:
have := epiOfEffectiveEpi π
instance : Preregular Stonean where
  exists_fac := by
    intro X Y Z f π hπ
    have := epiOfEffectiveEpi π
    

Proof state:
X Y Z : Stonean
f : X ⟶ Y
π : Z ⟶ Y
hπ : EffectiveEpi π
this : Epi π
⊢ ∃ W h, ∃ (_ : EffectiveEpi h), ∃ i, i ≫ π = h ≫ f

Next tactic:
exact ⟨X, 𝟙 X, inferInstance, Projective.factors f π⟩
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  

Proof state:
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
⊢ TFAE [EffectiveEpiFamily X π, Epi (Sigma.desc π), ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b]

Next tactic:
tfae_have 2 → 1
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · 

Proof state:
case tfae_2_to_1
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
⊢ Epi (Sigma.desc π) → EffectiveEpiFamily X π

Next tactic:
intro
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    

Proof state:
case tfae_2_to_1
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
✝ : Epi (Sigma.desc π)
⊢ EffectiveEpiFamily X π

Next tactic:
simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  

Proof state:
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
⊢ TFAE [EffectiveEpiFamily X π, Epi (Sigma.desc π), ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b]

Next tactic:
tfae_have 1 → 2
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · 

Proof state:
case tfae_1_to_2
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
⊢ EffectiveEpiFamily X π → Epi (Sigma.desc π)

Next tactic:
intro
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; 

Proof state:
case tfae_1_to_2
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
✝ : EffectiveEpiFamily X π
⊢ Epi (Sigma.desc π)

Next tactic:
infer_instance
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  

Proof state:
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
⊢ TFAE [EffectiveEpiFamily X π, Epi (Sigma.desc π), ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b]

Next tactic:
tfae_have 3 → 2
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · 

Proof state:
case tfae_3_to_2
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
⊢ (∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b) → Epi (Sigma.desc π)

Next tactic:
intro e
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    

Proof state:
case tfae_3_to_2
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
e : ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b
⊢ Epi (Sigma.desc π)

Next tactic:
rw [epi_iff_surjective]
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    

Proof state:
case tfae_3_to_2
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
e : ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b
⊢ Function.Surjective ⇑(Sigma.desc π)

Next tactic:
intro b
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    

Proof state:
case tfae_3_to_2
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
e : ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b
b : CoeSort.coe B
⊢ ∃ a, (Sigma.desc π) a = b

Next tactic:
obtain ⟨t, x, h⟩ := e b
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    obtain ⟨t, x, h⟩ := e b
    

Proof state:
case tfae_3_to_2.intro.intro
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
e : ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b
b : CoeSort.coe B
t : α
x : CoeSort.coe (X t)
h : (π t) x = b
⊢ ∃ a, (Sigma.desc π) a = b

Next tactic:
refine ⟨Sigma.ι X t x, ?_⟩
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    obtain ⟨t, x, h⟩ := e b
    refine ⟨Sigma.ι X t x, ?_⟩
    

Proof state:
case tfae_3_to_2.intro.intro
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
e : ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b
b : CoeSort.coe B
t : α
x : CoeSort.coe (X t)
h : (π t) x = b
⊢ (Sigma.desc π) ((Sigma.ι X t) x) = b

Next tactic:
change (Sigma.ι X t ≫ Sigma.desc π) x = _
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    obtain ⟨t, x, h⟩ := e b
    refine ⟨Sigma.ι X t x, ?_⟩
    change (Sigma.ι X t ≫ Sigma.desc π) x = _
    

Proof state:
case tfae_3_to_2.intro.intro
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
e : ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b
b : CoeSort.coe B
t : α
x : CoeSort.coe (X t)
h : (π t) x = b
⊢ (Sigma.ι X t ≫ Sigma.desc π) x = b

Next tactic:
simpa using h
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    obtain ⟨t, x, h⟩ := e b
    refine ⟨Sigma.ι X t x, ?_⟩
    change (Sigma.ι X t ≫ Sigma.desc π) x = _
    simpa using h
  

Proof state:
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
tfae_3_to_2 : (∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b) → Epi (Sigma.desc π)
⊢ TFAE [EffectiveEpiFamily X π, Epi (Sigma.desc π), ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b]

Next tactic:
tfae_have 2 → 3
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    obtain ⟨t, x, h⟩ := e b
    refine ⟨Sigma.ι X t x, ?_⟩
    change (Sigma.ι X t ≫ Sigma.desc π) x = _
    simpa using h
  tfae_have 2 → 3
  · 

Proof state:
case tfae_2_to_3
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
tfae_3_to_2 : (∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b) → Epi (Sigma.desc π)
⊢ Epi (Sigma.desc π) → ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b

Next tactic:
intro e
open List in
theorem effectiveEpiFamily_tfae
    {α : Type} [Fintype α] {B : Stonean.{u}}
    (X : α → Stonean.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ] := by
  tfae_have 2 → 1
  · intro
    simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1]
  tfae_have 1 → 2
  · intro; infer_instance
  tfae_have 3 → 2
  · intro e
    rw [epi_iff_surjective]
    intro b
    obtain ⟨t, x, h⟩ := e b
    refine ⟨Sigma.ι X t x, ?_⟩
    change (Sigma.ι X t ≫ Sigma.desc π) x = _
    simpa using h
  tfae_have 2 → 3
  · intro e; 

Proof state:
case tfae_2_to_3
α : Type
inst✝ : Fintype α
B : Stonean
X : α → Stonean
π : (a : α) → X a ⟶ B
tfae_2_to_1 : Epi (Sigma.desc π) → EffectiveEpiFamily X π
tfae_1_to_2 : EffectiveEpiFamily X π → Epi (Sigma.desc π)
tfae_3_to_2 : (∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b) → Epi (Sigma.desc π)
e : Epi (Sigma.desc π)
⊢ ∀ (b : CoeSort.coe B), ∃ a x, (π a) x = b

Next tactic:
rw [epi_iff_surjective] at e