l3lab/ntp-mathlib huggingface dataset:
theorem LSeriesSummable_iff_of_re_eq_re {f : ArithmeticFunction ℂ} {w z : ℂ} (h : w.re = z.re) :
    f.LSeriesSummable w ↔ f.LSeriesSummable z := by
  suffices h :
    ∀ n : ℕ, Complex.abs (f n) / Complex.abs (↑n ^ w) = Complex.abs (f n) / Complex.abs (↑n ^ z)
  · simp [LSeriesSummable, ← summable_norm_iff, h, Complex.norm_eq_abs]
  intro n
  cases' n with n; · simp
  apply congr rfl
  have h0 : (n.succ : ℂ) ≠ 0 := by
    rw [Ne.def, Nat.cast_eq_zero]
    apply n.succ_ne_zero
  rw [Complex.cpow_def, Complex.cpow_def, if_neg h0, if_neg h0, Complex.abs_exp_eq_iff_re_eq]
  

Proof state:
case h.succ
f : ArithmeticFunction ℂ
w z : ℂ
h : w.re = z.re
n : ℕ
h0 : ↑(succ n) ≠ 0
⊢ (Complex.log ↑(succ n) * w).re = (Complex.log ↑(succ n) * z).re

Next tactic:
simp only [h, Complex.mul_re, mul_eq_mul_left_iff, sub_right_inj]
theorem LSeriesSummable_iff_of_re_eq_re {f : ArithmeticFunction ℂ} {w z : ℂ} (h : w.re = z.re) :
    f.LSeriesSummable w ↔ f.LSeriesSummable z := by
  suffices h :
    ∀ n : ℕ, Complex.abs (f n) / Complex.abs (↑n ^ w) = Complex.abs (f n) / Complex.abs (↑n ^ z)
  · simp [LSeriesSummable, ← summable_norm_iff, h, Complex.norm_eq_abs]
  intro n
  cases' n with n; · simp
  apply congr rfl
  have h0 : (n.succ : ℂ) ≠ 0 := by
    rw [Ne.def, Nat.cast_eq_zero]
    apply n.succ_ne_zero
  rw [Complex.cpow_def, Complex.cpow_def, if_neg h0, if_neg h0, Complex.abs_exp_eq_iff_re_eq]
  simp only [h, Complex.mul_re, mul_eq_mul_left_iff, sub_right_inj]
  

Proof state:
case h.succ
f : ArithmeticFunction ℂ
w z : ℂ
h : w.re = z.re
n : ℕ
h0 : ↑(succ n) ≠ 0
⊢ w.im = z.im ∨ (Complex.log ↑(succ n)).im = 0

Next tactic:
right
theorem LSeriesSummable_iff_of_re_eq_re {f : ArithmeticFunction ℂ} {w z : ℂ} (h : w.re = z.re) :
    f.LSeriesSummable w ↔ f.LSeriesSummable z := by
  suffices h :
    ∀ n : ℕ, Complex.abs (f n) / Complex.abs (↑n ^ w) = Complex.abs (f n) / Complex.abs (↑n ^ z)
  · simp [LSeriesSummable, ← summable_norm_iff, h, Complex.norm_eq_abs]
  intro n
  cases' n with n; · simp
  apply congr rfl
  have h0 : (n.succ : ℂ) ≠ 0 := by
    rw [Ne.def, Nat.cast_eq_zero]
    apply n.succ_ne_zero
  rw [Complex.cpow_def, Complex.cpow_def, if_neg h0, if_neg h0, Complex.abs_exp_eq_iff_re_eq]
  simp only [h, Complex.mul_re, mul_eq_mul_left_iff, sub_right_inj]
  right
  

Proof state:
case h.succ.h
f : ArithmeticFunction ℂ
w z : ℂ
h : w.re = z.re
n : ℕ
h0 : ↑(succ n) ≠ 0
⊢ (Complex.log ↑(succ n)).im = 0

Next tactic:
rw [Complex.log_im, ← Complex.ofReal_nat_cast]
theorem LSeriesSummable_iff_of_re_eq_re {f : ArithmeticFunction ℂ} {w z : ℂ} (h : w.re = z.re) :
    f.LSeriesSummable w ↔ f.LSeriesSummable z := by
  suffices h :
    ∀ n : ℕ, Complex.abs (f n) / Complex.abs (↑n ^ w) = Complex.abs (f n) / Complex.abs (↑n ^ z)
  · simp [LSeriesSummable, ← summable_norm_iff, h, Complex.norm_eq_abs]
  intro n
  cases' n with n; · simp
  apply congr rfl
  have h0 : (n.succ : ℂ) ≠ 0 := by
    rw [Ne.def, Nat.cast_eq_zero]
    apply n.succ_ne_zero
  rw [Complex.cpow_def, Complex.cpow_def, if_neg h0, if_neg h0, Complex.abs_exp_eq_iff_re_eq]
  simp only [h, Complex.mul_re, mul_eq_mul_left_iff, sub_right_inj]
  right
  rw [Complex.log_im, ← Complex.ofReal_nat_cast]
  

Proof state:
case h.succ.h
f : ArithmeticFunction ℂ
w z : ℂ
h : w.re = z.re
n : ℕ
h0 : ↑(succ n) ≠ 0
⊢ Complex.arg ↑↑(succ n) = 0

Next tactic:
exact Complex.arg_ofReal_of_nonneg (le_of_lt (cast_pos.2 n.succ_pos))
theorem LSeriesSummable_of_bounded_of_one_lt_re {f : ArithmeticFunction ℂ} {m : ℝ}
    (h : ∀ n : ℕ, Complex.abs (f n) ≤ m) {z : ℂ} (hz : 1 < z.re) : f.LSeriesSummable z := by
  

Proof state:
f : ArithmeticFunction ℂ
m : ℝ
h : ∀ (n : ℕ), Complex.abs (f n) ≤ m
z : ℂ
hz : 1 < z.re
⊢ LSeriesSummable f z

Next tactic:
rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re)]
theorem LSeriesSummable_of_bounded_of_one_lt_re {f : ArithmeticFunction ℂ} {m : ℝ}
    (h : ∀ n : ℕ, Complex.abs (f n) ≤ m) {z : ℂ} (hz : 1 < z.re) : f.LSeriesSummable z := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re)]
  

Proof state:
f : ArithmeticFunction ℂ
m : ℝ
h : ∀ (n : ℕ), Complex.abs (f n) ≤ m
z : ℂ
hz : 1 < z.re
⊢ LSeriesSummable f ↑z.re

Next tactic:
apply LSeriesSummable_of_bounded_of_one_lt_real h
theorem LSeriesSummable_of_bounded_of_one_lt_re {f : ArithmeticFunction ℂ} {m : ℝ}
    (h : ∀ n : ℕ, Complex.abs (f n) ≤ m) {z : ℂ} (hz : 1 < z.re) : f.LSeriesSummable z := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re)]
  apply LSeriesSummable_of_bounded_of_one_lt_real h
  

Proof state:
f : ArithmeticFunction ℂ
m : ℝ
h : ∀ (n : ℕ), Complex.abs (f n) ≤ m
z : ℂ
hz : 1 < z.re
⊢ 1 < z.re

Next tactic:
exact hz
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  

Proof state:
z : ℂ
⊢ LSeriesSummable (↑ζ) z ↔ 1 < z.re

Next tactic:
rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  

Proof state:
z : ℂ
⊢ (Summable fun x => ‖↑ζ x / ↑x ^ ↑z.re‖) = Summable fun n => 1 / ↑n ^ z.re

Next tactic:
by_cases h0 : z.re = 0
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · 

Proof state:
case pos
z : ℂ
h0 : z.re = 0
⊢ (Summable fun x => ‖↑ζ x / ↑x ^ ↑z.re‖) = Summable fun n => 1 / ↑n ^ z.re

Next tactic:
rw [h0, ← summable_nat_add_iff 1]
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    

Proof state:
case pos
z : ℂ
h0 : z.re = 0
⊢ (Summable fun n => ‖↑ζ (n + 1) / ↑(n + 1) ^ ↑0‖) = Summable fun n => 1 / ↑n ^ 0

Next tactic:
apply congr rfl
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    

Proof state:
case pos
z : ℂ
h0 : z.re = 0
⊢ (fun n => ‖↑ζ (n + 1) / ↑(n + 1) ^ ↑0‖) = fun n => 1 / ↑n ^ 0

Next tactic:
ext n
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    ext n
    

Proof state:
case pos.h
z : ℂ
h0 : z.re = 0
n : ℕ
⊢ ‖↑ζ (n + 1) / ↑(n + 1) ^ ↑0‖ = 1 / ↑n ^ 0

Next tactic:
simp [n.succ_ne_zero]
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    ext n
    simp [n.succ_ne_zero]
  · 

Proof state:
case neg
z : ℂ
h0 : ¬z.re = 0
⊢ (Summable fun x => ‖↑ζ x / ↑x ^ ↑z.re‖) = Summable fun n => 1 / ↑n ^ z.re

Next tactic:
apply congr rfl
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    ext n
    simp [n.succ_ne_zero]
  · apply congr rfl
    

Proof state:
case neg
z : ℂ
h0 : ¬z.re = 0
⊢ (fun x => ‖↑ζ x / ↑x ^ ↑z.re‖) = fun n => 1 / ↑n ^ z.re

Next tactic:
ext ⟨- | n⟩
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    ext n
    simp [n.succ_ne_zero]
  · apply congr rfl
    ext ⟨- | n⟩
    · 

Proof state:
case neg.h.zero
z : ℂ
h0 : ¬z.re = 0
⊢ ‖↑ζ Nat.zero / ↑Nat.zero ^ ↑z.re‖ = 1 / ↑Nat.zero ^ z.re

Next tactic:
simp [h0]
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    ext n
    simp [n.succ_ne_zero]
  · apply congr rfl
    ext ⟨- | n⟩
    · simp [h0]
    

Proof state:
case neg.h.succ
z : ℂ
h0 : ¬z.re = 0
n✝ : ℕ
⊢ ‖↑ζ (succ n✝) / ↑(succ n✝) ^ ↑z.re‖ = 1 / ↑(succ n✝) ^ z.re

Next tactic:
simp only [cast_zero, natCoe_apply, zeta_apply, succ_ne_zero, if_false, cast_succ, one_div,
      Complex.norm_eq_abs, map_inv₀, Complex.abs_cpow_real, inv_inj, zero_add]
theorem zeta_LSeriesSummable_iff_one_lt_re {z : ℂ} : LSeriesSummable ζ z ↔ 1 < z.re := by
  rw [← LSeriesSummable_iff_of_re_eq_re (Complex.ofReal_re z.re), LSeriesSummable, ←
    summable_norm_iff, ← Real.summable_one_div_nat_rpow, iff_iff_eq]
  by_cases h0 : z.re = 0
  · rw [h0, ← summable_nat_add_iff 1]
    apply congr rfl
    ext n
    simp [n.succ_ne_zero]
  · apply congr rfl
    ext ⟨- | n⟩
    · simp [h0]
    simp only [cast_zero, natCoe_apply, zeta_apply, succ_ne_zero, if_false, cast_succ, one_div,
      Complex.norm_eq_abs, map_inv₀, Complex.abs_cpow_real, inv_inj, zero_add]
    

Proof state:
case neg.h.succ
z : ℂ
h0 : ¬z.re = 0
n✝ : ℕ
⊢ Complex.abs (↑n✝ + 1) ^ z.re = (↑n✝ + 1) ^ z.re

Next tactic:
rw [← cast_one, ← cast_add, Complex.abs_natCast, cast_add, cast_one]
@[simp]
theorem LSeries_add {f g : ArithmeticFunction ℂ} {z : ℂ} (hf : f.LSeriesSummable z)
    (hg : g.LSeriesSummable z) : (f + g).LSeries z = f.LSeries z + g.LSeries z := by
  

Proof state:
f g : ArithmeticFunction ℂ
z : ℂ
hf : LSeriesSummable f z
hg : LSeriesSummable g z
⊢ LSeries (f + g) z = LSeries f z + LSeries g z

Next tactic:
simp only [LSeries, add_apply]
@[simp]
theorem LSeries_add {f g : ArithmeticFunction ℂ} {z : ℂ} (hf : f.LSeriesSummable z)
    (hg : g.LSeriesSummable z) : (f + g).LSeries z = f.LSeries z + g.LSeries z := by
  simp only [LSeries, add_apply]
  

Proof state:
f g : ArithmeticFunction ℂ
z : ℂ
hf : LSeriesSummable f z
hg : LSeriesSummable g z
⊢ ∑' (n : ℕ), (f n + g n) / ↑n ^ z = ∑' (n : ℕ), f n / ↑n ^ z + ∑' (n : ℕ), g n / ↑n ^ z

Next tactic:
rw [← tsum_add hf hg]
@[simp]
theorem LSeries_add {f g : ArithmeticFunction ℂ} {z : ℂ} (hf : f.LSeriesSummable z)
    (hg : g.LSeriesSummable z) : (f + g).LSeries z = f.LSeries z + g.LSeries z := by
  simp only [LSeries, add_apply]
  rw [← tsum_add hf hg]
  

Proof state:
f g : ArithmeticFunction ℂ
z : ℂ
hf : LSeriesSummable f z
hg : LSeriesSummable g z
⊢ ∑' (n : ℕ), (f n + g n) / ↑n ^ z = ∑' (b : ℕ), (f b / ↑b ^ z + g b / ↑b ^ z)

Next tactic:
apply congr rfl (funext fun n => _)
@[simp]
theorem LSeries_add {f g : ArithmeticFunction ℂ} {z : ℂ} (hf : f.LSeriesSummable z)
    (hg : g.LSeriesSummable z) : (f + g).LSeries z = f.LSeries z + g.LSeries z := by
  simp only [LSeries, add_apply]
  rw [← tsum_add hf hg]
  apply congr rfl (funext fun n => _)
  

Proof state:
f g : ArithmeticFunction ℂ
z : ℂ
hf : LSeriesSummable f z
hg : LSeriesSummable g z
⊢ ∀ (n : ℕ), (f n + g n) / ↑n ^ z = f n / ↑n ^ z + g n / ↑n ^ z

Next tactic:
simp [_root_.add_div]
instance largeCategory : LargeCategory SSet := by
  

Proof state:
⊢ LargeCategory SSet

Next tactic:
dsimp only [SSet]
instance largeCategory : LargeCategory SSet := by
  dsimp only [SSet]
  

Proof state:
⊢ LargeCategory (SimplicialObject (Type ?u.23))

Next tactic:
infer_instance
instance hasLimits : HasLimits SSet := by
  

Proof state:
⊢ HasLimits SSet

Next tactic:
dsimp only [SSet]
instance hasLimits : HasLimits SSet := by
  dsimp only [SSet]
  

Proof state:
⊢ HasLimits (SimplicialObject (Type ?u.489))

Next tactic:
infer_instance
instance hasColimits : HasColimits SSet := by
  

Proof state:
⊢ HasColimits SSet

Next tactic:
dsimp only [SSet]
instance hasColimits : HasColimits SSet := by
  dsimp only [SSet]
  

Proof state:
⊢ HasColimits (SimplicialObject (Type ?u.579))

Next tactic:
infer_instance
/-- The boundary `∂Δ[n]` of the `n`-th standard simplex consists of
all `m`-simplices of `standardSimplex n` that are not surjective
(when viewed as monotone function `m → n`). -/
def boundary (n : ℕ) : SSet where
  obj m := { α : Δ[n].obj m // ¬Function.Surjective (asOrderHom α) }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      

Proof state:
n : ℕ
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // ¬Function.Surjective ⇑(asOrderHom α) }) m₁
⊢ ¬Function.Surjective ⇑(asOrderHom (f.unop ≫ ↑α))

Next tactic:
intro h
/-- The boundary `∂Δ[n]` of the `n`-th standard simplex consists of
all `m`-simplices of `standardSimplex n` that are not surjective
(when viewed as monotone function `m → n`). -/
def boundary (n : ℕ) : SSet where
  obj m := { α : Δ[n].obj m // ¬Function.Surjective (asOrderHom α) }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h
      

Proof state:
n : ℕ
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // ¬Function.Surjective ⇑(asOrderHom α) }) m₁
h : Function.Surjective ⇑(asOrderHom (f.unop ≫ ↑α))
⊢ False

Next tactic:
apply α.property
/-- The boundary `∂Δ[n]` of the `n`-th standard simplex consists of
all `m`-simplices of `standardSimplex n` that are not surjective
(when viewed as monotone function `m → n`). -/
def boundary (n : ℕ) : SSet where
  obj m := { α : Δ[n].obj m // ¬Function.Surjective (asOrderHom α) }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h
      apply α.property
      

Proof state:
n : ℕ
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // ¬Function.Surjective ⇑(asOrderHom α) }) m₁
h : Function.Surjective ⇑(asOrderHom (f.unop ≫ ↑α))
⊢ Function.Surjective ⇑(asOrderHom ↑α)

Next tactic:
exact Function.Surjective.of_comp h
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
⊢ Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i} ≠ Set.univ

Next tactic:
intro h
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h; 

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
h : Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i} = Set.univ
⊢ False

Next tactic:
apply α.property
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h; apply α.property
      

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
h : Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i} = Set.univ
⊢ Set.range ⇑(asOrderHom ↑α) ∪ {i} = Set.univ

Next tactic:
rw [Set.eq_univ_iff_forall] at h ⊢
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h; apply α.property
      rw [Set.eq_univ_iff_forall] at h ⊢; 

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
h : ∀ (x : Fin (n + 1)), x ∈ Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i}
⊢ ∀ (x : Fin (n + 1)), x ∈ Set.range ⇑(asOrderHom ↑α) ∪ {i}

Next tactic:
intro j
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h; apply α.property
      rw [Set.eq_univ_iff_forall] at h ⊢; intro j
      

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
h : ∀ (x : Fin (n + 1)), x ∈ Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i}
j : Fin (n + 1)
⊢ j ∈ Set.range ⇑(asOrderHom ↑α) ∪ {i}

Next tactic:
apply Or.imp _ id (h j)
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h; apply α.property
      rw [Set.eq_univ_iff_forall] at h ⊢; intro j
      apply Or.imp _ id (h j)
      

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
h : ∀ (x : Fin (n + 1)), x ∈ Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i}
j : Fin (n + 1)
⊢ j ∈ Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) → j ∈ Set.range ⇑(asOrderHom ↑α)

Next tactic:
intro hj
/-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
It consists of all `m`-simplices `α` of `Δ[n]`
for which the union of `{i}` and the range of `α` is not all of `n`
(when viewing `α` as monotone function `m → n`). -/
def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
  obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
  map {m₁ m₂} f α :=
    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
      intro h; apply α.property
      rw [Set.eq_univ_iff_forall] at h ⊢; intro j
      apply Or.imp _ id (h j)
      intro hj
      

Proof state:
n : ℕ
i : Fin (n + 1)
m₁ m₂ : SimplexCategoryᵒᵖ
f : m₁ ⟶ m₂
α : (fun m => { α // Set.range ⇑(asOrderHom α) ∪ {i} ≠ Set.univ }) m₁
h : ∀ (x : Fin (n + 1)), x ∈ Set.range ⇑(asOrderHom (f.unop ≫ ↑α)) ∪ {i}
j : Fin (n + 1)
hj : j ∈ Set.range ⇑(asOrderHom (f.unop ≫ ↑α))
⊢ j ∈ Set.range ⇑(asOrderHom ↑α)

Next tactic:
exact Set.range_comp_subset_range _ _ hj
instance Truncated.largeCategory (n : ℕ) : LargeCategory (Truncated n) := by
  

Proof state:
n : ℕ
⊢ LargeCategory (Truncated n)

Next tactic:
dsimp only [Truncated]
instance Truncated.largeCategory (n : ℕ) : LargeCategory (Truncated n) := by
  dsimp only [Truncated]
  

Proof state:
n : ℕ
⊢ LargeCategory (SimplicialObject.Truncated (Type ?u.76540) n)

Next tactic:
infer_instance
instance Truncated.hasLimits : HasLimits (Truncated n) := by
  

Proof state:
n : ℕ
⊢ HasLimits (Truncated n)

Next tactic:
dsimp only [Truncated]
instance Truncated.hasLimits : HasLimits (Truncated n) := by
  dsimp only [Truncated]
  

Proof state:
n : ℕ
⊢ HasLimits (SimplicialObject.Truncated (Type ?u.77020) n)

Next tactic:
infer_instance
instance Truncated.hasColimits : HasColimits (Truncated n) := by
  

Proof state:
n : ℕ
⊢ HasColimits (Truncated n)

Next tactic:
dsimp only [Truncated]
instance Truncated.hasColimits : HasColimits (Truncated n) := by
  dsimp only [Truncated]
  

Proof state:
n : ℕ
⊢ HasColimits (SimplicialObject.Truncated (Type ?u.77130) n)

Next tactic:
infer_instance
/-- Representation of a difference of two squares of commuting elements as a product. -/
theorem mul_self_sub_mul_self_eq [NonUnitalNonAssocRing R] {a b : R} (h : Commute a b) :
    a * a - b * b = (a + b) * (a - b) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝ : NonUnitalNonAssocRing R
a b : R
h : Commute a b
⊢ a * a - b * b = (a + b) * (a - b)

Next tactic:
rw [add_mul, mul_sub, mul_sub, h.eq, sub_add_sub_cancel]
theorem mul_self_sub_mul_self_eq' [NonUnitalNonAssocRing R] {a b : R} (h : Commute a b) :
    a * a - b * b = (a - b) * (a + b) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝ : NonUnitalNonAssocRing R
a b : R
h : Commute a b
⊢ a * a - b * b = (a - b) * (a + b)

Next tactic:
rw [mul_add, sub_mul, sub_mul, h.eq, sub_add_sub_cancel]
theorem mul_self_eq_mul_self_iff [NonUnitalNonAssocRing R] [NoZeroDivisors R] {a b : R}
    (h : Commute a b) : a * a = b * b ↔ a = b ∨ a = -b := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝¹ : NonUnitalNonAssocRing R
inst✝ : NoZeroDivisors R
a b : R
h : Commute a b
⊢ a * a = b * b ↔ a = b ∨ a = -b

Next tactic:
rw [← sub_eq_zero, h.mul_self_sub_mul_self_eq, mul_eq_zero, or_comm, sub_eq_zero,
    add_eq_zero_iff_eq_neg]
theorem mul_self_sub_one [NonAssocRing R] (a : R) : a * a - 1 = (a + 1) * (a - 1) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝ : NonAssocRing R
a : R
⊢ a * a - 1 = (a + 1) * (a - 1)

Next tactic:
rw [← (Commute.one_right a).mul_self_sub_mul_self_eq, mul_one]
theorem mul_self_eq_one_iff [NonAssocRing R] [NoZeroDivisors R] {a : R} :
    a * a = 1 ↔ a = 1 ∨ a = -1 := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝¹ : NonAssocRing R
inst✝ : NoZeroDivisors R
a : R
⊢ a * a = 1 ↔ a = 1 ∨ a = -1

Next tactic:
rw [← (Commute.one_right a).mul_self_eq_mul_self_iff, mul_one]
/-- In the unit group of an integral domain, a unit is its own inverse iff the unit is one or
  one's additive inverse. -/
theorem inv_eq_self_iff [Ring R] [NoZeroDivisors R] (u : Rˣ) : u⁻¹ = u ↔ u = 1 ∨ u = -1 := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
u : Rˣ
⊢ u⁻¹ = u ↔ u = 1 ∨ u = -1

Next tactic:
rw [inv_eq_iff_mul_eq_one]
/-- In the unit group of an integral domain, a unit is its own inverse iff the unit is one or
  one's additive inverse. -/
theorem inv_eq_self_iff [Ring R] [NoZeroDivisors R] (u : Rˣ) : u⁻¹ = u ↔ u = 1 ∨ u = -1 := by
  rw [inv_eq_iff_mul_eq_one]
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
u : Rˣ
⊢ u * u = 1 ↔ u = 1 ∨ u = -1

Next tactic:
simp only [ext_iff]
/-- In the unit group of an integral domain, a unit is its own inverse iff the unit is one or
  one's additive inverse. -/
theorem inv_eq_self_iff [Ring R] [NoZeroDivisors R] (u : Rˣ) : u⁻¹ = u ↔ u = 1 ∨ u = -1 := by
  rw [inv_eq_iff_mul_eq_one]
  simp only [ext_iff]
  

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type x
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
u : Rˣ
⊢ ↑(u * u) = ↑1 ↔ ↑u = ↑1 ∨ ↑u = ↑(-1)

Next tactic:
push_cast