l3lab/ntp-mathlib huggingface dataset:
/-- Let R be an integral domain and f ∈ R[X]. Let s be a finite index set.
Then, a fraction of the form f / ∏ (g i) can be rewritten as q + ∑ (r i) / (g i), where
deg(r i) < deg(g i), provided that the g i are monic and pairwise coprime.
-/
theorem div_eq_quo_add_sum_rem_div (f : R[X]) {ι : Type*} {g : ι → R[X]} {s : Finset ι}
    (hg : ∀ i ∈ s, (g i).Monic) (hcop : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)) :
    ∃ (q : R[X]) (r : ι → R[X]),
      (∀ i ∈ s, (r i).degree < (g i).degree) ∧
        ((↑f : K) / ∏ i in s, ↑(g i)) = ↑q + ∑ i in s, (r i : K) / (g i : K) := by
  classical
  induction' s using Finset.induction_on with a b hab Hind f generalizing f
  · refine' ⟨f, fun _ : ι => (0 : R[X]), fun i => _, by simp⟩
    rintro ⟨⟩
  obtain ⟨q₀, r₁, r₂, hdeg₁, _, hf : (↑f : K) / _ = _⟩ :=
    div_eq_quo_add_rem_div_add_rem_div R K f
      (hg a (b.mem_insert_self a) : Monic (g a))
      (monic_prod_of_monic _ _ fun i hi => hg i (Finset.mem_insert_of_mem hi) :
        Monic (∏ i : ι in b, g i))
      (IsCoprime.prod_right fun i hi =>
        hcop (Finset.mem_coe.2 (b.mem_insert_self a))
          (Finset.mem_coe.2 (Finset.mem_insert_of_mem hi)) (by rintro rfl; exact hab hi))
  · obtain ⟨q, r, hrdeg, IH⟩ :=
      Hind _ (fun i hi => hg i (Finset.mem_insert_of_mem hi))
        (Set.Pairwise.mono (Finset.coe_subset.2 fun i hi => Finset.mem_insert_of_mem hi) hcop)
    refine ⟨q₀ + q, fun i => if i = a then r₁ else r i, ?_, ?_⟩
    · intro i
      dsimp only
      split_ifs with h1
      · cases h1
        intro
        exact hdeg₁
      · intro hi
        exact hrdeg i (Finset.mem_of_mem_insert_of_ne hi h1)
    norm_cast at hf IH ⊢
    rw [Finset.prod_insert hab, hf, IH, Finset.sum_insert hab, if_pos rfl]
    trans (↑(q₀ + q : R[X]) : K) + (↑r₁ / ↑(g a) + ∑ i : ι in b, (r i : K) / (g i : K))
    · push_cast
      ring
    

Proof state:
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
ι : Type u_1
g : ι → R[X]
a : ι
b : Finset ι
hab : a ∉ b
Hind :
  ∀ (f : R[X]),
    (∀ i ∈ b, Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ i ∈ b, degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ i ∈ insert a b, Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ i ∈ b, degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑(q₀ + q) + (↑r₁ / ↑(g a) + ∑ i in b, ↑(r i) / ↑(g i)) =
    ↑(q₀ + q) + (↑r₁ / ↑(g a) + ∑ x in b, ↑(if x = a then r₁ else r x) / ↑(g x))

Next tactic:
congr 2
/-- Let R be an integral domain and f ∈ R[X]. Let s be a finite index set.
Then, a fraction of the form f / ∏ (g i) can be rewritten as q + ∑ (r i) / (g i), where
deg(r i) < deg(g i), provided that the g i are monic and pairwise coprime.
-/
theorem div_eq_quo_add_sum_rem_div (f : R[X]) {ι : Type*} {g : ι → R[X]} {s : Finset ι}
    (hg : ∀ i ∈ s, (g i).Monic) (hcop : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)) :
    ∃ (q : R[X]) (r : ι → R[X]),
      (∀ i ∈ s, (r i).degree < (g i).degree) ∧
        ((↑f : K) / ∏ i in s, ↑(g i)) = ↑q + ∑ i in s, (r i : K) / (g i : K) := by
  classical
  induction' s using Finset.induction_on with a b hab Hind f generalizing f
  · refine' ⟨f, fun _ : ι => (0 : R[X]), fun i => _, by simp⟩
    rintro ⟨⟩
  obtain ⟨q₀, r₁, r₂, hdeg₁, _, hf : (↑f : K) / _ = _⟩ :=
    div_eq_quo_add_rem_div_add_rem_div R K f
      (hg a (b.mem_insert_self a) : Monic (g a))
      (monic_prod_of_monic _ _ fun i hi => hg i (Finset.mem_insert_of_mem hi) :
        Monic (∏ i : ι in b, g i))
      (IsCoprime.prod_right fun i hi =>
        hcop (Finset.mem_coe.2 (b.mem_insert_self a))
          (Finset.mem_coe.2 (Finset.mem_insert_of_mem hi)) (by rintro rfl; exact hab hi))
  · obtain ⟨q, r, hrdeg, IH⟩ :=
      Hind _ (fun i hi => hg i (Finset.mem_insert_of_mem hi))
        (Set.Pairwise.mono (Finset.coe_subset.2 fun i hi => Finset.mem_insert_of_mem hi) hcop)
    refine ⟨q₀ + q, fun i => if i = a then r₁ else r i, ?_, ?_⟩
    · intro i
      dsimp only
      split_ifs with h1
      · cases h1
        intro
        exact hdeg₁
      · intro hi
        exact hrdeg i (Finset.mem_of_mem_insert_of_ne hi h1)
    norm_cast at hf IH ⊢
    rw [Finset.prod_insert hab, hf, IH, Finset.sum_insert hab, if_pos rfl]
    trans (↑(q₀ + q : R[X]) : K) + (↑r₁ / ↑(g a) + ∑ i : ι in b, (r i : K) / (g i : K))
    · push_cast
      ring
    congr 2
    

Proof state:
case e_a.e_a
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
ι : Type u_1
g : ι → R[X]
a : ι
b : Finset ι
hab : a ∉ b
Hind :
  ∀ (f : R[X]),
    (∀ i ∈ b, Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ i ∈ b, degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ i ∈ insert a b, Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ i ∈ b, degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ∑ i in b, ↑(r i) / ↑(g i) = ∑ x in b, ↑(if x = a then r₁ else r x) / ↑(g x)

Next tactic:
refine' Finset.sum_congr rfl fun x hxb => _
/-- Let R be an integral domain and f ∈ R[X]. Let s be a finite index set.
Then, a fraction of the form f / ∏ (g i) can be rewritten as q + ∑ (r i) / (g i), where
deg(r i) < deg(g i), provided that the g i are monic and pairwise coprime.
-/
theorem div_eq_quo_add_sum_rem_div (f : R[X]) {ι : Type*} {g : ι → R[X]} {s : Finset ι}
    (hg : ∀ i ∈ s, (g i).Monic) (hcop : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)) :
    ∃ (q : R[X]) (r : ι → R[X]),
      (∀ i ∈ s, (r i).degree < (g i).degree) ∧
        ((↑f : K) / ∏ i in s, ↑(g i)) = ↑q + ∑ i in s, (r i : K) / (g i : K) := by
  classical
  induction' s using Finset.induction_on with a b hab Hind f generalizing f
  · refine' ⟨f, fun _ : ι => (0 : R[X]), fun i => _, by simp⟩
    rintro ⟨⟩
  obtain ⟨q₀, r₁, r₂, hdeg₁, _, hf : (↑f : K) / _ = _⟩ :=
    div_eq_quo_add_rem_div_add_rem_div R K f
      (hg a (b.mem_insert_self a) : Monic (g a))
      (monic_prod_of_monic _ _ fun i hi => hg i (Finset.mem_insert_of_mem hi) :
        Monic (∏ i : ι in b, g i))
      (IsCoprime.prod_right fun i hi =>
        hcop (Finset.mem_coe.2 (b.mem_insert_self a))
          (Finset.mem_coe.2 (Finset.mem_insert_of_mem hi)) (by rintro rfl; exact hab hi))
  · obtain ⟨q, r, hrdeg, IH⟩ :=
      Hind _ (fun i hi => hg i (Finset.mem_insert_of_mem hi))
        (Set.Pairwise.mono (Finset.coe_subset.2 fun i hi => Finset.mem_insert_of_mem hi) hcop)
    refine ⟨q₀ + q, fun i => if i = a then r₁ else r i, ?_, ?_⟩
    · intro i
      dsimp only
      split_ifs with h1
      · cases h1
        intro
        exact hdeg₁
      · intro hi
        exact hrdeg i (Finset.mem_of_mem_insert_of_ne hi h1)
    norm_cast at hf IH ⊢
    rw [Finset.prod_insert hab, hf, IH, Finset.sum_insert hab, if_pos rfl]
    trans (↑(q₀ + q : R[X]) : K) + (↑r₁ / ↑(g a) + ∑ i : ι in b, (r i : K) / (g i : K))
    · push_cast
      ring
    congr 2
    refine' Finset.sum_congr rfl fun x hxb => _
    

Proof state:
case e_a.e_a
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
ι : Type u_1
g : ι → R[X]
a : ι
b : Finset ι
hab : a ∉ b
Hind :
  ∀ (f : R[X]),
    (∀ i ∈ b, Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ i ∈ b, degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ i ∈ insert a b, Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ i ∈ b, degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
x : ι
hxb : x ∈ b
⊢ ↑(r x) / ↑(g x) = ↑(if x = a then r₁ else r x) / ↑(g x)

Next tactic:
rw [if_neg]
/-- Let R be an integral domain and f ∈ R[X]. Let s be a finite index set.
Then, a fraction of the form f / ∏ (g i) can be rewritten as q + ∑ (r i) / (g i), where
deg(r i) < deg(g i), provided that the g i are monic and pairwise coprime.
-/
theorem div_eq_quo_add_sum_rem_div (f : R[X]) {ι : Type*} {g : ι → R[X]} {s : Finset ι}
    (hg : ∀ i ∈ s, (g i).Monic) (hcop : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)) :
    ∃ (q : R[X]) (r : ι → R[X]),
      (∀ i ∈ s, (r i).degree < (g i).degree) ∧
        ((↑f : K) / ∏ i in s, ↑(g i)) = ↑q + ∑ i in s, (r i : K) / (g i : K) := by
  classical
  induction' s using Finset.induction_on with a b hab Hind f generalizing f
  · refine' ⟨f, fun _ : ι => (0 : R[X]), fun i => _, by simp⟩
    rintro ⟨⟩
  obtain ⟨q₀, r₁, r₂, hdeg₁, _, hf : (↑f : K) / _ = _⟩ :=
    div_eq_quo_add_rem_div_add_rem_div R K f
      (hg a (b.mem_insert_self a) : Monic (g a))
      (monic_prod_of_monic _ _ fun i hi => hg i (Finset.mem_insert_of_mem hi) :
        Monic (∏ i : ι in b, g i))
      (IsCoprime.prod_right fun i hi =>
        hcop (Finset.mem_coe.2 (b.mem_insert_self a))
          (Finset.mem_coe.2 (Finset.mem_insert_of_mem hi)) (by rintro rfl; exact hab hi))
  · obtain ⟨q, r, hrdeg, IH⟩ :=
      Hind _ (fun i hi => hg i (Finset.mem_insert_of_mem hi))
        (Set.Pairwise.mono (Finset.coe_subset.2 fun i hi => Finset.mem_insert_of_mem hi) hcop)
    refine ⟨q₀ + q, fun i => if i = a then r₁ else r i, ?_, ?_⟩
    · intro i
      dsimp only
      split_ifs with h1
      · cases h1
        intro
        exact hdeg₁
      · intro hi
        exact hrdeg i (Finset.mem_of_mem_insert_of_ne hi h1)
    norm_cast at hf IH ⊢
    rw [Finset.prod_insert hab, hf, IH, Finset.sum_insert hab, if_pos rfl]
    trans (↑(q₀ + q : R[X]) : K) + (↑r₁ / ↑(g a) + ∑ i : ι in b, (r i : K) / (g i : K))
    · push_cast
      ring
    congr 2
    refine' Finset.sum_congr rfl fun x hxb => _
    rw [if_neg]
    

Proof state:
case e_a.e_a.hnc
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
ι : Type u_1
g : ι → R[X]
a : ι
b : Finset ι
hab : a ∉ b
Hind :
  ∀ (f : R[X]),
    (∀ i ∈ b, Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ i ∈ b, degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ i ∈ insert a b, Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ i ∈ b, degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
x : ι
hxb : x ∈ b
⊢ ¬x = a

Next tactic:
rintro rfl
/-- Let R be an integral domain and f ∈ R[X]. Let s be a finite index set.
Then, a fraction of the form f / ∏ (g i) can be rewritten as q + ∑ (r i) / (g i), where
deg(r i) < deg(g i), provided that the g i are monic and pairwise coprime.
-/
theorem div_eq_quo_add_sum_rem_div (f : R[X]) {ι : Type*} {g : ι → R[X]} {s : Finset ι}
    (hg : ∀ i ∈ s, (g i).Monic) (hcop : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)) :
    ∃ (q : R[X]) (r : ι → R[X]),
      (∀ i ∈ s, (r i).degree < (g i).degree) ∧
        ((↑f : K) / ∏ i in s, ↑(g i)) = ↑q + ∑ i in s, (r i : K) / (g i : K) := by
  classical
  induction' s using Finset.induction_on with a b hab Hind f generalizing f
  · refine' ⟨f, fun _ : ι => (0 : R[X]), fun i => _, by simp⟩
    rintro ⟨⟩
  obtain ⟨q₀, r₁, r₂, hdeg₁, _, hf : (↑f : K) / _ = _⟩ :=
    div_eq_quo_add_rem_div_add_rem_div R K f
      (hg a (b.mem_insert_self a) : Monic (g a))
      (monic_prod_of_monic _ _ fun i hi => hg i (Finset.mem_insert_of_mem hi) :
        Monic (∏ i : ι in b, g i))
      (IsCoprime.prod_right fun i hi =>
        hcop (Finset.mem_coe.2 (b.mem_insert_self a))
          (Finset.mem_coe.2 (Finset.mem_insert_of_mem hi)) (by rintro rfl; exact hab hi))
  · obtain ⟨q, r, hrdeg, IH⟩ :=
      Hind _ (fun i hi => hg i (Finset.mem_insert_of_mem hi))
        (Set.Pairwise.mono (Finset.coe_subset.2 fun i hi => Finset.mem_insert_of_mem hi) hcop)
    refine ⟨q₀ + q, fun i => if i = a then r₁ else r i, ?_, ?_⟩
    · intro i
      dsimp only
      split_ifs with h1
      · cases h1
        intro
        exact hdeg₁
      · intro hi
        exact hrdeg i (Finset.mem_of_mem_insert_of_ne hi h1)
    norm_cast at hf IH ⊢
    rw [Finset.prod_insert hab, hf, IH, Finset.sum_insert hab, if_pos rfl]
    trans (↑(q₀ + q : R[X]) : K) + (↑r₁ / ↑(g a) + ∑ i : ι in b, (r i : K) / (g i : K))
    · push_cast
      ring
    congr 2
    refine' Finset.sum_congr rfl fun x hxb => _
    rw [if_neg]
    rintro rfl
    

Proof state:
case e_a.e_a.hnc
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
ι : Type u_1
g : ι → R[X]
b : Finset ι
Hind :
  ∀ (f : R[X]),
    (∀ i ∈ b, Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ i ∈ b, degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f q₀ r₁ r₂ : R[X]
left✝ : degree r₂ < degree (∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ i ∈ b, degree (r i) < degree (g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
x : ι
hxb : x ∈ b
hab : x ∉ b
hg : ∀ i ∈ insert x b, Monic (g i)
hcop : Set.Pairwise ↑(insert x b) fun i j => IsCoprime (g i) (g j)
hdeg₁ : degree r₁ < degree (g x)
hf✝ : ↑f / (↑(g x) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g x) + ↑r₂ / ↑(∏ i in b, g i)
hf : ↑f / ↑(g x * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g x) + ↑r₂ / ↑(∏ i in b, g i)
⊢ False

Next tactic:
exact hab hxb
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by 

Proof state:
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A A₁ A₂ : IndexSet Δ
h₁ : A₁.fst = A₂.fst
⊢ A₁.fst.unop = A₂.fst.unop

Next tactic:
rw [h₁]
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂ := by
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A A₁ A₂ : IndexSet Δ
h₁ : A₁.fst = A₂.fst
h₂ : e A₁ ≫ eqToHom (_ : A₁.fst.unop = A₂.fst.unop) = e A₂
⊢ A₁ = A₂

Next tactic:
rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂ := by
  rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩
  

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A A₂ : IndexSet Δ
Δ₁ : SimplexCategoryᵒᵖ
α₁ : Δ.unop ⟶ Δ₁.unop
hα₁ : Epi α₁
h₁ : { fst := Δ₁, snd := { val := α₁, property := hα₁ } }.fst = A₂.fst
h₂ :
  e { fst := Δ₁, snd := { val := α₁, property := hα₁ } } ≫
      eqToHom (_ : { fst := Δ₁, snd := { val := α₁, property := hα₁ } }.fst.unop = A₂.fst.unop) =
    e A₂
⊢ { fst := Δ₁, snd := { val := α₁, property := hα₁ } } = A₂

Next tactic:
rcases A₂ with ⟨Δ₂, ⟨α₂, hα₂⟩⟩
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂ := by
  rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩
  rcases A₂ with ⟨Δ₂, ⟨α₂, hα₂⟩⟩
  

Proof state:
case mk.mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategoryᵒᵖ
α₁ : Δ.unop ⟶ Δ₁.unop
hα₁ : Epi α₁
Δ₂ : SimplexCategoryᵒᵖ
α₂ : Δ.unop ⟶ Δ₂.unop
hα₂ : Epi α₂
h₁ : { fst := Δ₁, snd := { val := α₁, property := hα₁ } }.fst = { fst := Δ₂, snd := { val := α₂, property := hα₂ } }.fst
h₂ :
  e { fst := Δ₁, snd := { val := α₁, property := hα₁ } } ≫
      eqToHom
        (_ :
          { fst := Δ₁, snd := { val := α₁, property := hα₁ } }.fst.unop =
            { fst := Δ₂, snd := { val := α₂, property := hα₂ } }.fst.unop) =
    e { fst := Δ₂, snd := { val := α₂, property := hα₂ } }
⊢ { fst := Δ₁, snd := { val := α₁, property := hα₁ } } = { fst := Δ₂, snd := { val := α₂, property := hα₂ } }

Next tactic:
simp only at h₁
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂ := by
  rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩
  rcases A₂ with ⟨Δ₂, ⟨α₂, hα₂⟩⟩
  simp only at h₁
  

Proof state:
case mk.mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategoryᵒᵖ
α₁ : Δ.unop ⟶ Δ₁.unop
hα₁ : Epi α₁
Δ₂ : SimplexCategoryᵒᵖ
α₂ : Δ.unop ⟶ Δ₂.unop
hα₂ : Epi α₂
h₁ : Δ₁ = Δ₂
h₂ :
  e { fst := Δ₁, snd := { val := α₁, property := hα₁ } } ≫
      eqToHom
        (_ :
          { fst := Δ₁, snd := { val := α₁, property := hα₁ } }.fst.unop =
            { fst := Δ₂, snd := { val := α₂, property := hα₂ } }.fst.unop) =
    e { fst := Δ₂, snd := { val := α₂, property := hα₂ } }
⊢ { fst := Δ₁, snd := { val := α₁, property := hα₁ } } = { fst := Δ₂, snd := { val := α₂, property := hα₂ } }

Next tactic:
subst h₁
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂ := by
  rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩
  rcases A₂ with ⟨Δ₂, ⟨α₂, hα₂⟩⟩
  simp only at h₁
  subst h₁
  

Proof state:
case mk.mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategoryᵒᵖ
α₁ : Δ.unop ⟶ Δ₁.unop
hα₁ : Epi α₁
α₂ : Δ.unop ⟶ Δ₁.unop
hα₂ : Epi α₂
h₂ :
  e { fst := Δ₁, snd := { val := α₁, property := hα₁ } } ≫
      eqToHom
        (_ :
          { fst := Δ₁, snd := { val := α₁, property := hα₁ } }.fst.unop =
            { fst := Δ₁, snd := { val := α₂, property := hα₂ } }.fst.unop) =
    e { fst := Δ₁, snd := { val := α₂, property := hα₂ } }
⊢ { fst := Δ₁, snd := { val := α₁, property := hα₁ } } = { fst := Δ₁, snd := { val := α₂, property := hα₂ } }

Next tactic:
simp only [eqToHom_refl, comp_id, IndexSet.e] at h₂
theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) :
    A₁ = A₂ := by
  rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩
  rcases A₂ with ⟨Δ₂, ⟨α₂, hα₂⟩⟩
  simp only at h₁
  subst h₁
  simp only [eqToHom_refl, comp_id, IndexSet.e] at h₂
  

Proof state:
case mk.mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.919, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategoryᵒᵖ
α₁ : Δ.unop ⟶ Δ₁.unop
hα₁ : Epi α₁
α₂ : Δ.unop ⟶ Δ₁.unop
hα₂ : Epi α₂
h₂ : α₁ = α₂
⊢ { fst := Δ₁, snd := { val := α₁, property := hα₁ } } = { fst := Δ₁, snd := { val := α₂, property := hα₂ } }

Next tactic:
simp only [h₂]
instance : Fintype (IndexSet Δ) :=
  Fintype.ofInjective
    (fun A =>
      ⟨⟨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))⟩,
        A.e.toOrderHom⟩ :
      IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1))
    (by
      

Proof state:
C : Type u_1
inst✝ : Category.{?u.1629, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
⊢ Function.Injective fun A =>
    { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
      snd := ⇑(Hom.toOrderHom (e A)) }

Next tactic:
rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁
instance : Fintype (IndexSet Δ) :=
  Fintype.ofInjective
    (fun A =>
      ⟨⟨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))⟩,
        A.e.toOrderHom⟩ :
      IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1))
    (by
      rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁
      

Proof state:
case mk.mk
C : Type u_1
inst✝ : Category.{?u.1629, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategoryᵒᵖ
α₁ : { α // Epi α }
Δ₂ : SimplexCategoryᵒᵖ
α₂ : { α // Epi α }
h₁ :
  (fun A =>
        { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
          snd := ⇑(Hom.toOrderHom (e A)) })
      { fst := Δ₁, snd := α₁ } =
    (fun A =>
        { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
          snd := ⇑(Hom.toOrderHom (e A)) })
      { fst := Δ₂, snd := α₂ }
⊢ { fst := Δ₁, snd := α₁ } = { fst := Δ₂, snd := α₂ }

Next tactic:
induction' Δ₁ using Opposite.rec with Δ₁
instance : Fintype (IndexSet Δ) :=
  Fintype.ofInjective
    (fun A =>
      ⟨⟨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))⟩,
        A.e.toOrderHom⟩ :
      IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1))
    (by
      rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁
      induction' Δ₁ using Opposite.rec with Δ₁
      

Proof state:
case mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.1629, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₂ : SimplexCategoryᵒᵖ
α₂ : { α // Epi α }
Δ₁ : SimplexCategory
α₁ : { α // Epi α }
h₁ :
  (fun A =>
        { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
          snd := ⇑(Hom.toOrderHom (e A)) })
      { fst := { unop := Δ₁ }, snd := α₁ } =
    (fun A =>
        { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
          snd := ⇑(Hom.toOrderHom (e A)) })
      { fst := Δ₂, snd := α₂ }
⊢ { fst := { unop := Δ₁ }, snd := α₁ } = { fst := Δ₂, snd := α₂ }

Next tactic:
induction' Δ₂ using Opposite.rec with Δ₂
instance : Fintype (IndexSet Δ) :=
  Fintype.ofInjective
    (fun A =>
      ⟨⟨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))⟩,
        A.e.toOrderHom⟩ :
      IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1))
    (by
      rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁
      induction' Δ₁ using Opposite.rec with Δ₁
      induction' Δ₂ using Opposite.rec with Δ₂
      

Proof state:
case mk.mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.1629, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategory
α₁ : { α // Epi α }
Δ₂ : SimplexCategory
α₂ : { α // Epi α }
h₁ :
  (fun A =>
        { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
          snd := ⇑(Hom.toOrderHom (e A)) })
      { fst := { unop := Δ₁ }, snd := α₁ } =
    (fun A =>
        { fst := { val := len A.fst.unop, isLt := (_ : len A.fst.unop < Nat.succ (len Δ.unop)) },
          snd := ⇑(Hom.toOrderHom (e A)) })
      { fst := { unop := Δ₂ }, snd := α₂ }
⊢ { fst := { unop := Δ₁ }, snd := α₁ } = { fst := { unop := Δ₂ }, snd := α₂ }

Next tactic:
simp only [unop_op, Sigma.mk.inj_iff, Fin.mk.injEq] at h₁
instance : Fintype (IndexSet Δ) :=
  Fintype.ofInjective
    (fun A =>
      ⟨⟨A.1.unop.len, Nat.lt_succ_iff.mpr (len_le_of_epi (inferInstance : Epi A.e))⟩,
        A.e.toOrderHom⟩ :
      IndexSet Δ → Sigma fun k : Fin (Δ.unop.len + 1) => Fin (Δ.unop.len + 1) → Fin (k + 1))
    (by
      rintro ⟨Δ₁, α₁⟩ ⟨Δ₂, α₂⟩ h₁
      induction' Δ₁ using Opposite.rec with Δ₁
      induction' Δ₂ using Opposite.rec with Δ₂
      simp only [unop_op, Sigma.mk.inj_iff, Fin.mk.injEq] at h₁
      

Proof state:
case mk.mk.mk.mk
C : Type u_1
inst✝ : Category.{?u.1629, u_1} C
Δ : SimplexCategoryᵒᵖ
A : IndexSet Δ
Δ₁ : SimplexCategory
α₁ : { α // Epi α }
Δ₂ : SimplexCategory
α₂ : { α // Epi α }
h₁ :
  len Δ₁ = len Δ₂ ∧
    HEq ⇑(Hom.toOrderHom (e { fst := { unop := Δ₁ }, snd := α₁ }))
      ⇑(Hom.toOrderHom (e { fst := { unop := Δ₂ }, snd := α₂ }))
⊢ { fst := { unop := Δ₁ }, snd := α₁ } = { fst := { unop := Δ₂ }, snd := α₂ }

Next tactic:
have h₂ : Δ₁ = Δ₂ := by
        ext1
        simpa only [Fin.mk_eq_mk] using h₁.1