[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₁ : ∃ k, k ≠ 1 ∧ x + y = k • (x - y)
h₂ : ‖z - y‖ = ‖z + y‖
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
obtain ⟨k, hk_ne_one, hk⟩ := h₁
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
let r := (k - 1)⁻¹ * (k + 1)
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
have hxy : x = r • y :=
  by
  rw [← smul_smul, eq_inv_smul_iff₀ (sub_ne_zero.mpr hk_ne_one), ← sub_eq_zero]
  calc
    (k - 1) • x - (k + 1) • y = k • x - x - (k • y + y) := by simp_rw [sub_smul, add_smul, one_smul]
    _ = k • x - k • y - (x + y) := by simp_rw [← sub_sub, sub_right_comm]
    _ = k • (x - y) - (x + y) := by rw [← smul_sub k x y]
    _ = 0 := sub_eq_zero.mpr hk.symm
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ x = r • y
[PROOFSTEP]
rw [← smul_smul, eq_inv_smul_iff₀ (sub_ne_zero.mpr hk_ne_one), ← sub_eq_zero]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ (k - 1) • x - (k + 1) • y = 0
[PROOFSTEP]
calc
  (k - 1) • x - (k + 1) • y = k • x - x - (k • y + y) := by simp_rw [sub_smul, add_smul, one_smul]
  _ = k • x - k • y - (x + y) := by simp_rw [← sub_sub, sub_right_comm]
  _ = k • (x - y) - (x + y) := by rw [← smul_sub k x y]
  _ = 0 := sub_eq_zero.mpr hk.symm
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ (k - 1) • x - (k + 1) • y = k • x - x - (k • y + y)
[PROOFSTEP]
simp_rw [sub_smul, add_smul, one_smul]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ k • x - x - (k • y + y) = k • x - k • y - (x + y)
[PROOFSTEP]
simp_rw [← sub_sub, sub_right_comm]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
⊢ k • x - k • y - (x + y) = k • (x - y) - (x + y)
[PROOFSTEP]
rw [← smul_sub k x y]
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
have hzy : ⟪z, y⟫ = 0 := by
  rwa [inner_eq_zero_iff_angle_eq_pi_div_two, ← norm_add_eq_norm_sub_iff_angle_eq_pi_div_two, eq_comm]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
⊢ inner z y = 0
[PROOFSTEP]
rwa [inner_eq_zero_iff_angle_eq_pi_div_two, ← norm_add_eq_norm_sub_iff_angle_eq_pi_div_two, eq_comm]
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
have hzx : ⟪z, x⟫ = 0 := by rw [hxy, inner_smul_right, hzy, mul_zero]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
⊢ inner z x = 0
[PROOFSTEP]
rw [hxy, inner_smul_right, hzy, mul_zero]
[GOAL]
case intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖x - y‖ * ‖x + y‖ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
calc
  ‖x - y‖ * ‖x + y‖ = ‖(r - 1) • y‖ * ‖(r + 1) • y‖ := by simp [sub_smul, add_smul, hxy]
  _ = ‖r - 1‖ * ‖y‖ * (‖r + 1‖ * ‖y‖) := by simp_rw [norm_smul]
  _ = ‖r - 1‖ * ‖r + 1‖ * ‖y‖ ^ 2 := by ring
  _ = |(r - 1) * (r + 1) * ‖y‖ ^ 2| := by simp [abs_mul]
  _ = |r ^ 2 * ‖y‖ ^ 2 - ‖y‖ ^ 2| := by ring_nf
  _ = |‖x‖ ^ 2 - ‖y‖ ^ 2| := by simp [hxy, norm_smul, mul_pow, sq_abs]
  _ = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2| := by simp [norm_add_sq_real, norm_sub_sq_real, hzy, hzx, abs_sub_comm]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖x - y‖ * ‖x + y‖ = ‖(r - 1) • y‖ * ‖(r + 1) • y‖
[PROOFSTEP]
simp [sub_smul, add_smul, hxy]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖(r - 1) • y‖ * ‖(r + 1) • y‖ = ‖r - 1‖ * ‖y‖ * (‖r + 1‖ * ‖y‖)
[PROOFSTEP]
simp_rw [norm_smul]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖r - 1‖ * ‖y‖ * (‖r + 1‖ * ‖y‖) = ‖r - 1‖ * ‖r + 1‖ * ‖y‖ ^ 2
[PROOFSTEP]
ring
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ ‖r - 1‖ * ‖r + 1‖ * ‖y‖ ^ 2 = |(r - 1) * (r + 1) * ‖y‖ ^ 2|
[PROOFSTEP]
simp [abs_mul]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ |(r - 1) * (r + 1) * ‖y‖ ^ 2| = |r ^ 2 * ‖y‖ ^ 2 - ‖y‖ ^ 2|
[PROOFSTEP]
ring_nf
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ |r ^ 2 * ‖y‖ ^ 2 - ‖y‖ ^ 2| = |‖x‖ ^ 2 - ‖y‖ ^ 2|
[PROOFSTEP]
simp [hxy, norm_smul, mul_pow, sq_abs]
[GOAL]
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x y z : V
h₂ : ‖z - y‖ = ‖z + y‖
k : ℝ
hk_ne_one : k ≠ 1
hk : x + y = k • (x - y)
r : ℝ := (k - 1)⁻¹ * (k + 1)
hxy : x = r • y
hzy : inner z y = 0
hzx : inner z x = 0
⊢ |‖x‖ ^ 2 - ‖y‖ ^ 2| = |‖z + y‖ ^ 2 - ‖z - x‖ ^ 2|
[PROOFSTEP]
simp [norm_add_sq_real, norm_sub_sq_real, hzy, hzx, abs_sub_comm]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
let m : P := midpoint ℝ a b
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h1 := vsub_sub_vsub_cancel_left a p m
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h2 := vsub_sub_vsub_cancel_left p q m
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h3 := vsub_sub_vsub_cancel_left a q m
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
have h : ∀ r, b -ᵥ r = m -ᵥ r + (m -ᵥ a) := fun r => by
  rw [midpoint_vsub_left, ← right_vsub_midpoint, add_comm, vsub_add_vsub_cancel]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
r : P
⊢ b -ᵥ r = m -ᵥ r + (m -ᵥ a)
[PROOFSTEP]
rw [midpoint_vsub_left, ← right_vsub_midpoint, add_comm, vsub_add_vsub_cancel]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
iterate 4 rw [dist_eq_norm_vsub V]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ dist a p * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖a -ᵥ p‖ * dist b p = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖a -ᵥ p‖ * ‖b -ᵥ p‖ = |dist b q ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖a -ᵥ p‖ * ‖b -ᵥ p‖ = |‖b -ᵥ q‖ ^ 2 - dist p q ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖a -ᵥ p‖ * ‖b -ᵥ p‖ = |‖b -ᵥ q‖ ^ 2 - ‖p -ᵥ q‖ ^ 2|
[PROOFSTEP]
rw [← h1, ← h2, h, h]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hp : ∃ k, k ≠ 1 ∧ b -ᵥ p = k • (a -ᵥ p)
hq : dist a q = dist b q
m : P := midpoint ℝ a b
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖m -ᵥ p - (m -ᵥ a)‖ * ‖m -ᵥ p + (m -ᵥ a)‖ = |‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2|
[PROOFSTEP]
rw [← h1, h] at hp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
hq : dist a q = dist b q
m : P := midpoint ℝ a b
hp : ∃ k, k ≠ 1 ∧ m -ᵥ p + (m -ᵥ a) = k • (m -ᵥ p - (m -ᵥ a))
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖m -ᵥ p - (m -ᵥ a)‖ * ‖m -ᵥ p + (m -ᵥ a)‖ = |‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2|
[PROOFSTEP]
rw [dist_eq_norm_vsub V a q, dist_eq_norm_vsub V b q, ← h3, h] at hq
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b p q : P
m : P := midpoint ℝ a b
hq : ‖m -ᵥ q - (m -ᵥ a)‖ = ‖m -ᵥ q + (m -ᵥ a)‖
hp : ∃ k, k ≠ 1 ∧ m -ᵥ p + (m -ᵥ a) = k • (m -ᵥ p - (m -ᵥ a))
h1 : m -ᵥ p - (m -ᵥ a) = a -ᵥ p
h2 : m -ᵥ q - (m -ᵥ p) = p -ᵥ q
h3 : m -ᵥ q - (m -ᵥ a) = a -ᵥ q
h : ∀ (r : P), b -ᵥ r = m -ᵥ r + (m -ᵥ a)
⊢ ‖m -ᵥ p - (m -ᵥ a)‖ * ‖m -ᵥ p + (m -ᵥ a)‖ = |‖m -ᵥ q + (m -ᵥ a)‖ ^ 2 - ‖m -ᵥ q - (m -ᵥ p)‖ ^ 2|
[PROOFSTEP]
exact mul_norm_eq_abs_sub_sq_norm hp hq
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨q, r, h'⟩ := (cospherical_def { a, b, c, d }).mp h
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨ha, hb, hc, hd⟩ := h' a (by simp), h' b (by simp), h' c (by simp), h' d (by simp)
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ a ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ b ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ c ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
⊢ d ∈ {a, b, c, d}
[PROOFSTEP]
simp
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
ha : dist a q = r
hb : dist b q = r
hc : dist c q = r
hd : dist d q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
rw [← hd] at hc
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
ha : dist a q = r
hb : dist b q = r
hc : dist c q = dist d q
hd : dist d q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
rw [← hb] at ha
[GOAL]
case intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∃ k₁, k₁ ≠ 1 ∧ b -ᵥ p = k₁ • (a -ᵥ p)
hcpd : ∃ k₂, k₂ ≠ 1 ∧ d -ᵥ p = k₂ • (c -ᵥ p)
q : P
r : ℝ
h' : ∀ (p : P), p ∈ {a, b, c, d} → dist p q = r
ha : dist a q = dist b q
hb : dist b q = r
hc : dist c q = dist d q
hd : dist d q = r
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
rw [mul_dist_eq_abs_sub_sq_dist hapb ha, hb, mul_dist_eq_abs_sub_sq_dist hcpd hc, hd]
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₁, _, hab⟩ := angle_eq_pi_iff.mp hapb
[GOAL]
case intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₂, _, hcd⟩ := angle_eq_pi_iff.mp hcpd
[GOAL]
case intro.intro.intro.intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝¹ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
left✝ : k₂ < 0
hcd : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
exact mul_dist_eq_mul_dist_of_cospherical h ⟨k₁, by linarith, hab⟩ ⟨k₂, by linarith, hcd⟩
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝¹ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
left✝ : k₂ < 0
hcd : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₁ ≠ 1
[PROOFSTEP]
linarith
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hapb : ∠ a p b = π
hcpd : ∠ c p d = π
k₁ : ℝ
left✝¹ : k₁ < 0
hab : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
left✝ : k₂ < 0
hcd : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₂ ≠ 1
[PROOFSTEP]
linarith
[GOAL]
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₁, -, hab₁⟩ := angle_eq_zero_iff.mp hapb
[GOAL]
case intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
obtain ⟨-, k₂, -, hcd₁⟩ := angle_eq_zero_iff.mp hcpd
[GOAL]
case intro.intro.intro.intro.intro.intro
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ dist a p * dist b p = dist c p * dist d p
[PROOFSTEP]
refine' mul_dist_eq_mul_dist_of_cospherical h ⟨k₁, _, hab₁⟩ ⟨k₂, _, hcd₁⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₁ ≠ 1
[PROOFSTEP]
by_contra hnot
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
⊢ k₂ ≠ 1
[PROOFSTEP]
by_contra hnot
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
hnot : k₁ = 1
⊢ False
[PROOFSTEP]
simp_all only [Classical.not_not, one_smul]
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
hnot : k₂ = 1
⊢ False
[PROOFSTEP]
simp_all only [Classical.not_not, one_smul]
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ k₂ : ℝ
hab₁ : b -ᵥ p = a -ᵥ p
hcd₁ : d -ᵥ p = k₂ • (c -ᵥ p)
hnot : k₁ = 1
⊢ False
case intro.intro.intro.intro.intro.intro.refine'_2
V : Type u_1
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
P : Type u_2
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
a b c d p : P
h : Cospherical {a, b, c, d}
hab : a ≠ b
hcd : c ≠ d
hapb : ∠ a p b = 0
hcpd : ∠ c p d = 0
k₁ : ℝ
hab₁ : b -ᵥ p = k₁ • (a -ᵥ p)
k₂ : ℝ
hcd₁ : d -ᵥ p = c -ᵥ p
hnot : k₂ = 1
⊢ False
[PROOFSTEP]
exacts [hab (vsub_left_cancel hab₁).symm, hcd (vsub_left_cancel hcd₁).symm]


[GOAL]
C : Type u_1
inst✝¹ : Category.{?u.28, u_1} C
inst✝ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
⊢ ∀ [inst : IsIso (N₁.map f)], IsIso f
[PROOFSTEP]
intro
  -- restating the result in a way that allows induction on the degree n
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
⊢ IsIso f
[PROOFSTEP]
suffices ∀ n : ℕ, IsIso (f.app (op [n]))
  by
  haveI : ∀ Δ : SimplexCategoryᵒᵖ, IsIso (f.app Δ) := fun Δ => this Δ.unop.len
  apply NatIso.isIso_of_isIso_app
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
this : ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
⊢ IsIso f
[PROOFSTEP]
haveI : ∀ Δ : SimplexCategoryᵒᵖ, IsIso (f.app Δ) := fun Δ => this Δ.unop.len
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
this✝ : ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
this : ∀ (Δ : SimplexCategoryᵒᵖ), IsIso (NatTrans.app f Δ)
⊢ IsIso f
[PROOFSTEP]
apply NatIso.isIso_of_isIso_app
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
⊢ ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
[PROOFSTEP]
have h₁ := HomologicalComplex.congr_hom (Karoubi.hom_ext_iff.mp (IsIso.hom_inv_id (N₁.map f)))
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₁ : ∀ (i : ℕ), HomologicalComplex.Hom.f (N₁.map f ≫ inv (N₁.map f)).f i = HomologicalComplex.Hom.f (𝟙 (N₁.obj X)).f i
⊢ ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
[PROOFSTEP]
have h₂ := HomologicalComplex.congr_hom (Karoubi.hom_ext_iff.mp (IsIso.inv_hom_id (N₁.map f)))
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₁ : ∀ (i : ℕ), HomologicalComplex.Hom.f (N₁.map f ≫ inv (N₁.map f)).f i = HomologicalComplex.Hom.f (𝟙 (N₁.obj X)).f i
h₂ : ∀ (i : ℕ), HomologicalComplex.Hom.f (inv (N₁.map f) ≫ N₁.map f).f i = HomologicalComplex.Hom.f (𝟙 (N₁.obj Y)).f i
⊢ ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
[PROOFSTEP]
have h₃ := fun n => Karoubi.HomologicalComplex.p_comm_f_assoc (inv (N₁.map f)) n (f.app (op [n]))
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₁ : ∀ (i : ℕ), HomologicalComplex.Hom.f (N₁.map f ≫ inv (N₁.map f)).f i = HomologicalComplex.Hom.f (𝟙 (N₁.obj X)).f i
h₂ : ∀ (i : ℕ), HomologicalComplex.Hom.f (inv (N₁.map f) ≫ N₁.map f).f i = HomologicalComplex.Hom.f (𝟙 (N₁.obj Y)).f i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f (N₁.obj Y).p n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f (N₁.obj X).p n ≫ NatTrans.app f (op [n])
⊢ ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
[PROOFSTEP]
simp only [N₁_map_f, Karoubi.comp_f, HomologicalComplex.comp_f, AlternatingFaceMapComplex.map_f, N₁_obj_p,
  Karoubi.id_eq, assoc] at h₁ h₂ h₃
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
⊢ ∀ (n : ℕ), IsIso (NatTrans.app f (op [n]))
[PROOFSTEP]
intro n
[GOAL]
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
n : ℕ
⊢ IsIso (NatTrans.app f (op [n]))
[PROOFSTEP]
induction' n with n hn
[GOAL]
case zero
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
⊢ IsIso (NatTrans.app f (op [Nat.zero]))
[PROOFSTEP]
use(inv (N₁.map f)).f.f 0
[GOAL]
case h
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
⊢ NatTrans.app f (op [Nat.zero]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [Nat.zero])) ∧
    HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ NatTrans.app f (op [Nat.zero]) = 𝟙 (Y.obj (op [Nat.zero]))
[PROOFSTEP]
have h₁₀ := h₁ 0
[GOAL]
case h
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
h₁₀ :
  HomologicalComplex.Hom.f PInfty 0 ≫ NatTrans.app f (op [0]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 =
    HomologicalComplex.Hom.f PInfty 0
⊢ NatTrans.app f (op [Nat.zero]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [Nat.zero])) ∧
    HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ NatTrans.app f (op [Nat.zero]) = 𝟙 (Y.obj (op [Nat.zero]))
[PROOFSTEP]
have h₂₀ := h₂ 0
[GOAL]
case h
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
h₁₀ :
  HomologicalComplex.Hom.f PInfty 0 ≫ NatTrans.app f (op [0]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 =
    HomologicalComplex.Hom.f PInfty 0
h₂₀ :
  HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ HomologicalComplex.Hom.f PInfty 0 ≫ NatTrans.app f (op [0]) =
    HomologicalComplex.Hom.f PInfty 0
⊢ NatTrans.app f (op [Nat.zero]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [Nat.zero])) ∧
    HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ NatTrans.app f (op [Nat.zero]) = 𝟙 (Y.obj (op [Nat.zero]))
[PROOFSTEP]
dsimp at h₁₀ h₂₀
[GOAL]
case h
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
h₁₀ : 𝟙 (X.obj (op [0])) ≫ NatTrans.app f (op [0]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [0]))
h₂₀ : HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ 𝟙 (X.obj (op [0])) ≫ NatTrans.app f (op [0]) = 𝟙 (Y.obj (op [0]))
⊢ NatTrans.app f (op [Nat.zero]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [Nat.zero])) ∧
    HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ NatTrans.app f (op [Nat.zero]) = 𝟙 (Y.obj (op [Nat.zero]))
[PROOFSTEP]
simp only [id_comp, comp_id] at h₁₀ h₂₀
[GOAL]
case h
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
h₁₀ : NatTrans.app f (op [0]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [0]))
h₂₀ : HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ NatTrans.app f (op [0]) = 𝟙 (Y.obj (op [0]))
⊢ NatTrans.app f (op [Nat.zero]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 = 𝟙 (X.obj (op [Nat.zero])) ∧
    HomologicalComplex.Hom.f (inv (N₁.map f)).f 0 ≫ NatTrans.app f (op [Nat.zero]) = 𝟙 (Y.obj (op [Nat.zero]))
[PROOFSTEP]
tauto
[GOAL]
case succ
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
n : ℕ
hn : IsIso (NatTrans.app f (op [n]))
⊢ IsIso (NatTrans.app f (op [Nat.succ n]))
[PROOFSTEP]
haveI := hn
[GOAL]
case succ
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
n : ℕ
hn this : IsIso (NatTrans.app f (op [n]))
⊢ IsIso (NatTrans.app f (op [Nat.succ n]))
[PROOFSTEP]
use φ {
      a := PInfty.f (n + 1) ≫ (inv (N₁.map f)).f.f (n + 1)
      b := fun i => inv (f.app (op [n])) ≫ X.σ i }
[GOAL]
case h
C : Type u_1
inst✝² : Category.{?u.28, u_1} C
inst✝¹ : Preadditive C
X Y : SimplicialObject C
f : X ⟶ Y
inst✝ : IsIso (N₁.map f)
h₂ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f (inv (N₁.map f)).f i ≫ HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) =
      HomologicalComplex.Hom.f PInfty i
h₃ :
  ∀ (n : ℕ),
    HomologicalComplex.Hom.f PInfty n ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ NatTrans.app f (op [n]) =
      HomologicalComplex.Hom.f (inv (N₁.map f)).f n ≫ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f (op [n])
h₁ :
  ∀ (i : ℕ),
    HomologicalComplex.Hom.f PInfty i ≫ NatTrans.app f (op [i]) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f i =
      HomologicalComplex.Hom.f PInfty i
n : ℕ
hn this : IsIso (NatTrans.app f (op [n]))
⊢ NatTrans.app f (op [Nat.succ n]) ≫
        φ
          { a := HomologicalComplex.Hom.f PInfty (n + 1) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f (n + 1),
            b := fun i => inv (NatTrans.app f (op [n])) ≫ SimplicialObject.σ X i } =
      𝟙 (X.obj (op [Nat.succ n])) ∧
    φ
          { a := HomologicalComplex.Hom.f PInfty (n + 1) ≫ HomologicalComplex.Hom.f (inv (N₁.map f)).f (n + 1),
            b := fun i => inv (NatTrans.app f (op [n])) ≫ SimplicialObject.σ X i } ≫
        NatTrans.app f (op [Nat.succ n]) =
      𝟙 (Y.obj (op [Nat.succ n]))
[PROOFSTEP]
simp only [MorphComponents.id, ← id_φ, ← preComp_φ, preComp, ← postComp_φ, postComp, PInfty_f_naturality_assoc,
  IsIso.hom_inv_id_assoc, assoc, IsIso.inv_hom_id_assoc, SimplicialObject.σ_naturality, h₁, h₂, h₃]
[GOAL]
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
⊢ N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor =
    karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
      N₁ ⋙
        (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
          Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
[PROOFSTEP]
refine' CategoryTheory.Functor.ext (fun P => _) fun P Q f => _
[GOAL]
case refine'_1
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
⊢ (N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P =
    (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
          N₁ ⋙
            (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
              Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
      P
[PROOFSTEP]
refine' HomologicalComplex.ext _ _
[GOAL]
case refine'_1.refine'_1
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
⊢ ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P).X =
    ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
            N₁ ⋙
              (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
        P).X
[PROOFSTEP]
ext n
[GOAL]
case refine'_1.refine'_1.h.h_X
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
⊢ (HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n).X =
    (HomologicalComplex.X
        ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
              N₁ ⋙
                (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
          P)
        n).X
[PROOFSTEP]
rfl
[GOAL]
case refine'_1.refine'_1.h.h_p
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
⊢ (HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n).p ≫
      eqToHom
        (_ :
          (HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n).X =
            (HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n).X) =
    eqToHom
        (_ :
          (HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n).X =
            (HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n).X) ≫
      (HomologicalComplex.X
          ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                N₁ ⋙
                  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                    Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
            P)
          n).p
[PROOFSTEP]
dsimp
[GOAL]
case refine'_1.refine'_1.h.h_p
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
⊢ (HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app P.p (op [n])) ≫ 𝟙 (P.X.obj (op [n])) =
    𝟙 (P.X.obj (op [n])) ≫ (HomologicalComplex.Hom.f PInfty n).f
[PROOFSTEP]
simp only [karoubi_PInfty_f, comp_id, PInfty_f_naturality, id_comp, eqToHom_refl]
[GOAL]
case refine'_1.refine'_2
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
⊢ ∀ (i j : ℕ),
    ComplexShape.Rel (ComplexShape.down ℕ) i j →
      HomologicalComplex.d ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) i j ≫
          eqToHom
            (_ :
              HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) j =
                HomologicalComplex.X
                  ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                        N₁ ⋙
                          (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                            Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                              (ComplexShape.down ℕ)).obj
                    P)
                  j) =
        eqToHom
            (_ :
              HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) i =
                HomologicalComplex.X
                  ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                        N₁ ⋙
                          (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                            Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                              (ComplexShape.down ℕ)).obj
                    P)
                  i) ≫
          HomologicalComplex.d
            ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                  N₁ ⋙
                    (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                      Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
              P)
            i j
[PROOFSTEP]
rintro _ n (rfl : n + 1 = _)
[GOAL]
case refine'_1.refine'_2
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
⊢ HomologicalComplex.d ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) (n + 1) n ≫
      eqToHom
        (_ :
          HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n =
            HomologicalComplex.X
              ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                    N₁ ⋙
                      (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                        Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
                P)
              n) =
    eqToHom
        (_ :
          HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) (n + 1) =
            HomologicalComplex.X
              ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                    N₁ ⋙
                      (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                        Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
                P)
              (n + 1)) ≫
      HomologicalComplex.d
        ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
              N₁ ⋙
                (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
          P)
        (n + 1) n
[PROOFSTEP]
ext
[GOAL]
case refine'_1.refine'_2.h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
⊢ (HomologicalComplex.d ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) (n + 1) n ≫
        eqToHom
          (_ :
            HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n =
              HomologicalComplex.X
                ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                      N₁ ⋙
                        (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                          Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                            (ComplexShape.down ℕ)).obj
                  P)
                n)).f =
    (eqToHom
          (_ :
            HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) (n + 1) =
              HomologicalComplex.X
                ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                      N₁ ⋙
                        (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                          Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                            (ComplexShape.down ℕ)).obj
                  P)
                (n + 1)) ≫
        HomologicalComplex.d
          ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                N₁ ⋙
                  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                    Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
            P)
          (n + 1) n).f
[PROOFSTEP]
have h := (AlternatingFaceMapComplex.map P.p).comm (n + 1) n
[GOAL]
case refine'_1.refine'_2.h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
h :
  HomologicalComplex.Hom.f (AlternatingFaceMapComplex.map P.p) (n + 1) ≫
      HomologicalComplex.d (AlternatingFaceMapComplex.obj P.X) (n + 1) n =
    HomologicalComplex.d (AlternatingFaceMapComplex.obj P.X) (n + 1) n ≫
      HomologicalComplex.Hom.f (AlternatingFaceMapComplex.map P.p) n
⊢ (HomologicalComplex.d ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) (n + 1) n ≫
        eqToHom
          (_ :
            HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) n =
              HomologicalComplex.X
                ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                      N₁ ⋙
                        (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                          Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                            (ComplexShape.down ℕ)).obj
                  P)
                n)).f =
    (eqToHom
          (_ :
            HomologicalComplex.X ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P) (n + 1) =
              HomologicalComplex.X
                ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                      N₁ ⋙
                        (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                          Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                            (ComplexShape.down ℕ)).obj
                  P)
                (n + 1)) ≫
        HomologicalComplex.d
          ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                N₁ ⋙
                  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                    Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
            P)
          (n + 1) n).f
[PROOFSTEP]
dsimp [N₂, karoubiChainComplexEquivalence, KaroubiHomologicalComplexEquivalence.Functor.obj] at h ⊢
[GOAL]
case refine'_1.refine'_2.h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P : Karoubi (SimplicialObject C)
n : ℕ
h :
  NatTrans.app P.p (op [n + 1]) ≫ HomologicalComplex.d (AlternatingFaceMapComplex.obj P.X) (n + 1) n =
    HomologicalComplex.d (AlternatingFaceMapComplex.obj P.X) (n + 1) n ≫ NatTrans.app P.p (op [n])
⊢ ((HomologicalComplex.Hom.f PInfty (n + 1) ≫ NatTrans.app P.p (op [n + 1])) ≫
        HomologicalComplex.d (AlternatingFaceMapComplex.obj P.X) (n + 1) n) ≫
      (eqToHom
          (_ :
            Karoubi.mk (P.X.obj (op [n])) (HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app P.p (op [n])) =
              HomologicalComplex.X
                ((Functor.mapHomologicalComplex (KaroubiKaroubi.inverse C) (ComplexShape.down ℕ)).obj
                  (HomologicalComplex.mk
                    (fun n =>
                      Karoubi.mk ((KaroubiFunctorCategoryEmbedding.obj P).obj (op [n]))
                        (HomologicalComplex.Hom.f PInfty n))
                    fun i j =>
                    Karoubi.Hom.mk
                      (HomologicalComplex.Hom.f PInfty i ≫
                        HomologicalComplex.d (AlternatingFaceMapComplex.obj (KaroubiFunctorCategoryEmbedding.obj P)) i
                          j)))
                n)).f =
    (eqToHom
          (_ :
            Karoubi.mk (P.X.obj (op [n + 1]))
                (HomologicalComplex.Hom.f PInfty (n + 1) ≫ NatTrans.app P.p (op [n + 1])) =
              HomologicalComplex.X
                ((Functor.mapHomologicalComplex (KaroubiKaroubi.inverse C) (ComplexShape.down ℕ)).obj
                  (HomologicalComplex.mk
                    (fun n =>
                      Karoubi.mk ((KaroubiFunctorCategoryEmbedding.obj P).obj (op [n]))
                        (HomologicalComplex.Hom.f PInfty n))
                    fun i j =>
                    Karoubi.Hom.mk
                      (HomologicalComplex.Hom.f PInfty i ≫
                        HomologicalComplex.d (AlternatingFaceMapComplex.obj (KaroubiFunctorCategoryEmbedding.obj P)) i
                          j)))
                (n + 1))).f ≫
      (HomologicalComplex.Hom.f PInfty (n + 1)).f ≫
        (HomologicalComplex.d (AlternatingFaceMapComplex.obj (KaroubiFunctorCategoryEmbedding.obj P)) (n + 1) n).f
[PROOFSTEP]
simp only [assoc, Karoubi.eqToHom_f, eqToHom_refl, comp_id, karoubi_alternatingFaceMapComplex_d, karoubi_PInfty_f, ←
  HomologicalComplex.Hom.comm_assoc, ← h, app_idem_assoc]
[GOAL]
case refine'_2
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P Q : Karoubi (SimplicialObject C)
f : P ⟶ Q
⊢ (N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).map f =
    eqToHom
        (_ :
          (N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P =
            (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                  N₁ ⋙
                    (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                      Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
              P) ≫
      (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
              N₁ ⋙
                (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).map
          f ≫
        eqToHom
          (_ :
            (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                    N₁ ⋙
                      (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                        Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).obj
                Q =
              (N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj Q)
[PROOFSTEP]
ext n
[GOAL]
case refine'_2.h.h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P Q : Karoubi (SimplicialObject C)
f : P ⟶ Q
n : ℕ
⊢ (HomologicalComplex.Hom.f ((N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).map f) n).f =
    (HomologicalComplex.Hom.f
        (eqToHom
            (_ :
              (N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj P =
                (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                      N₁ ⋙
                        (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                          Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                            (ComplexShape.down ℕ)).obj
                  P) ≫
          (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                  N₁ ⋙
                    (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                      Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).map
              f ≫
            eqToHom
              (_ :
                (karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
                        N₁ ⋙
                          (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
                            Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse
                              (ComplexShape.down ℕ)).obj
                    Q =
                  (N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor).obj Q))
        n).f
[PROOFSTEP]
dsimp [KaroubiKaroubi.inverse, Functor.mapHomologicalComplex]
[GOAL]
case refine'_2.h.h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
P Q : Karoubi (SimplicialObject C)
f : P ⟶ Q
n : ℕ
⊢ HomologicalComplex.Hom.f PInfty n ≫ NatTrans.app f.f (op [n]) =
    (HomologicalComplex.Hom.f
          (eqToHom
            (_ :
              (karoubiChainComplexEquivalence C ℕ).functor.obj (N₂.obj P) =
                HomologicalComplex.mk (fun i => Karoubi.mk (P.X.obj (op [i])) (HomologicalComplex.Hom.f PInfty i).f)
                  fun i j =>
                  Karoubi.Hom.mk
                    (HomologicalComplex.d
                          ((karoubiChainComplexEquivalence (Karoubi C) ℕ).functor.obj
                            (N₁.obj (KaroubiFunctorCategoryEmbedding.obj P)))
                          i j).f.f))
          n).f ≫
      ((HomologicalComplex.Hom.f PInfty n).f ≫ NatTrans.app f.f (op [n])) ≫
        (HomologicalComplex.Hom.f
            (eqToHom
              (_ :
                (HomologicalComplex.mk (fun i => Karoubi.mk (Q.X.obj (op [i])) (HomologicalComplex.Hom.f PInfty i).f)
                    fun i j =>
                    Karoubi.Hom.mk
                      (HomologicalComplex.d
                            ((karoubiChainComplexEquivalence (Karoubi C) ℕ).functor.obj
                              (N₁.obj (KaroubiFunctorCategoryEmbedding.obj Q)))
                            i j).f.f) =
                  (karoubiChainComplexEquivalence C ℕ).functor.obj (N₂.obj Q)))
            n).f
[PROOFSTEP]
simp only [karoubi_PInfty_f, HomologicalComplex.eqToHom_f, Karoubi.eqToHom_f, assoc, comp_id, PInfty_f_naturality,
  app_p_comp, karoubiChainComplexEquivalence_functor_obj_X_p, N₂_obj_p_f, eqToHom_refl, PInfty_f_naturality_assoc,
  app_comp_p, PInfty_f_idem_assoc]
[GOAL]
C : Type u_1
inst✝¹ : Category.{?u.74447, u_1} C
inst✝ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
⊢ ∀ [inst : IsIso (N₂.map f)], IsIso f
[PROOFSTEP]
intro
  -- The following functor `F` reflects isomorphism because it is
      -- a composition of four functors which reflects isomorphisms.
      -- Then, it suffices to show that `F.map f` is an isomorphism.
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
⊢ IsIso f
[PROOFSTEP]
let F₁ := karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
⊢ IsIso f
[PROOFSTEP]
let F₂ : SimplicialObject (Karoubi C) ⥤ _ := N₁
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
⊢ IsIso f
[PROOFSTEP]
let F₃ := (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
⊢ IsIso f
[PROOFSTEP]
let F₄ := Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
⊢ IsIso f
[PROOFSTEP]
let F := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
⊢ IsIso f
[PROOFSTEP]
haveI : ReflectsIsomorphisms F₁ := reflectsIsomorphisms_of_full_and_faithful _
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this : ReflectsIsomorphisms F₁
⊢ IsIso f
[PROOFSTEP]
haveI : ReflectsIsomorphisms F₂ := by infer_instance
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this : ReflectsIsomorphisms F₁
⊢ ReflectsIsomorphisms F₂
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝ : ReflectsIsomorphisms F₁
this : ReflectsIsomorphisms F₂
⊢ IsIso f
[PROOFSTEP]
haveI : ReflectsIsomorphisms F₃ := reflectsIsomorphisms_of_full_and_faithful _
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝¹ : ReflectsIsomorphisms F₁
this✝ : ReflectsIsomorphisms F₂
this : ReflectsIsomorphisms F₃
⊢ IsIso f
[PROOFSTEP]
haveI : ReflectsIsomorphisms ((KaroubiKaroubi.equivalence C).inverse) := reflectsIsomorphisms_of_full_and_faithful _
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝² : ReflectsIsomorphisms F₁
this✝¹ : ReflectsIsomorphisms F₂
this✝ : ReflectsIsomorphisms F₃
this : ReflectsIsomorphisms (KaroubiKaroubi.equivalence C).inverse
⊢ IsIso f
[PROOFSTEP]
have : IsIso (F.map f) := by
  simp only
  rw [← compatibility_N₂_N₁_karoubi, Functor.comp_map]
  apply Functor.map_isIso
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝² : ReflectsIsomorphisms F₁
this✝¹ : ReflectsIsomorphisms F₂
this✝ : ReflectsIsomorphisms F₃
this : ReflectsIsomorphisms (KaroubiKaroubi.equivalence C).inverse
⊢ IsIso (F.map f)
[PROOFSTEP]
simp only
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝² : ReflectsIsomorphisms F₁
this✝¹ : ReflectsIsomorphisms F₂
this✝ : ReflectsIsomorphisms F₃
this : ReflectsIsomorphisms (KaroubiKaroubi.equivalence C).inverse
⊢ IsIso
    ((karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙
          N₁ ⋙
            (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙
              Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)).map
      f)
[PROOFSTEP]
rw [← compatibility_N₂_N₁_karoubi, Functor.comp_map]
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝² : ReflectsIsomorphisms F₁
this✝¹ : ReflectsIsomorphisms F₂
this✝ : ReflectsIsomorphisms F₃
this : ReflectsIsomorphisms (KaroubiKaroubi.equivalence C).inverse
⊢ IsIso ((karoubiChainComplexEquivalence C ℕ).functor.map (N₂.map f))
[PROOFSTEP]
apply Functor.map_isIso
[GOAL]
C : Type u_1
inst✝² : Category.{?u.74447, u_1} C
inst✝¹ : Preadditive C
A✝ B✝ : Karoubi (SimplicialObject C)
f : A✝ ⟶ B✝
inst✝ : IsIso (N₂.map f)
F₁ : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ SimplexCategoryᵒᵖ ⥤ Karoubi C :=
  karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C
F₂ : SimplicialObject (Karoubi C) ⥤ Karoubi (ChainComplex (Karoubi C) ℕ) := N₁
F₃ : Karoubi (ChainComplex (Karoubi C) ℕ) ⥤ ChainComplex (Karoubi (Karoubi C)) ℕ :=
  (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor
F₄ : HomologicalComplex (Karoubi (Karoubi C)) (ComplexShape.down ℕ) ⥤
  HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) :=
  Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse (ComplexShape.down ℕ)
F : Karoubi (SimplexCategoryᵒᵖ ⥤ C) ⥤ HomologicalComplex (Karoubi C) (ComplexShape.down ℕ) := F₁ ⋙ F₂ ⋙ F₃ ⋙ F₄
this✝³ : ReflectsIsomorphisms F₁
this✝² : ReflectsIsomorphisms F₂
this✝¹ : ReflectsIsomorphisms F₃
this✝ : ReflectsIsomorphisms (KaroubiKaroubi.equivalence C).inverse
this : IsIso (F.map f)
⊢ IsIso f
[PROOFSTEP]
exact isIso_of_reflects_iso f F


[GOAL]
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
⊢ untrop (min a b) = untrop (if a ≤ b then a else b)
[PROOFSTEP]
simp [min_def]
[GOAL]
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
⊢ (if a ≤ b then untrop a else untrop b) = untrop (if a ≤ b then a else b)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
h✝ : a ≤ b
⊢ untrop a = untrop a
[PROOFSTEP]
simp
[GOAL]
case neg
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
h✝ : ¬a ≤ b
⊢ untrop b = untrop b
[PROOFSTEP]
simp
[GOAL]
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
⊢ untrop (max a b) = untrop (if a ≤ b then b else a)
[PROOFSTEP]
simp [max_def]
[GOAL]
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
⊢ (if a ≤ b then untrop b else untrop a) = untrop (if a ≤ b then b else a)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
h✝ : a ≤ b
⊢ untrop b = untrop b
[PROOFSTEP]
simp
[GOAL]
case neg
R : Type u
inst✝ : LinearOrder R
src✝ : PartialOrder (Tropical R) := instPartialOrderTropical
a b : Tropical R
h✝ : ¬a ≤ b
⊢ untrop a = untrop a
[PROOFSTEP]
simp
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y : Tropical R
h : x ≤ y
⊢ untrop (x + y) = untrop x
[PROOFSTEP]
simpa using h
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y : Tropical R
h : y ≤ x
⊢ untrop (x + y) = untrop y
[PROOFSTEP]
simpa using h
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y : Tropical R
⊢ x + y = x ↔ x ≤ y
[PROOFSTEP]
rw [trop_add_def, trop_eq_iff_eq_untrop, ← untrop_le_iff, min_eq_left_iff]
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y : Tropical R
⊢ x + y = y ↔ y ≤ x
[PROOFSTEP]
rw [trop_add_def, trop_eq_iff_eq_untrop, ← untrop_le_iff, min_eq_right_iff]
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
⊢ x + y = z ↔ x = z ∧ x ≤ y ∨ y = z ∧ y ≤ x
[PROOFSTEP]
rw [trop_add_def, trop_eq_iff_eq_untrop]
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
⊢ min (untrop x) (untrop y) = untrop z ↔ x = z ∧ x ≤ y ∨ y = z ∧ y ≤ x
[PROOFSTEP]
simp [min_eq_iff]
[GOAL]
R : Type u
inst✝ : LinearOrder R
a b : Tropical (WithTop R)
⊢ a + b = 0 ↔ a = 0 ∧ b = 0
[PROOFSTEP]
rw [add_eq_iff]
[GOAL]
R : Type u
inst✝ : LinearOrder R
a b : Tropical (WithTop R)
⊢ a = 0 ∧ a ≤ b ∨ b = 0 ∧ b ≤ a ↔ a = 0 ∧ b = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u
inst✝ : LinearOrder R
a b : Tropical (WithTop R)
⊢ a = 0 ∧ a ≤ b ∨ b = 0 ∧ b ≤ a → a = 0 ∧ b = 0
[PROOFSTEP]
rintro (⟨rfl, h⟩ | ⟨rfl, h⟩)
[GOAL]
case mp.inl.intro
R : Type u
inst✝ : LinearOrder R
b : Tropical (WithTop R)
h : 0 ≤ b
⊢ 0 = 0 ∧ b = 0
[PROOFSTEP]
exact ⟨rfl, le_antisymm (le_zero _) h⟩
[GOAL]
case mp.inr.intro
R : Type u
inst✝ : LinearOrder R
a : Tropical (WithTop R)
h : 0 ≤ a
⊢ a = 0 ∧ 0 = 0
[PROOFSTEP]
exact ⟨le_antisymm (le_zero _) h, rfl⟩
[GOAL]
case mpr
R : Type u
inst✝ : LinearOrder R
a b : Tropical (WithTop R)
⊢ a = 0 ∧ b = 0 → a = 0 ∧ a ≤ b ∨ b = 0 ∧ b ≤ a
[PROOFSTEP]
rintro ⟨rfl, rfl⟩
[GOAL]
case mpr.intro
R : Type u
inst✝ : LinearOrder R
⊢ 0 = 0 ∧ 0 ≤ 0 ∨ 0 = 0 ∧ 0 ≤ 0
[PROOFSTEP]
simp
[GOAL]
R : Type u
inst✝² : LinearOrder R
inst✝¹ : OrderTop R
inst✝ : Zero R
src✝¹ : One (Tropical R) := instOneTropical
src✝ : AddCommMonoid (Tropical R) := instAddCommMonoidTropical
n : ℕ
⊢ untrop (NatCast.natCast (n + 1)) = untrop (NatCast.natCast n + 1)
[PROOFSTEP]
cases n
[GOAL]
case zero
R : Type u
inst✝² : LinearOrder R
inst✝¹ : OrderTop R
inst✝ : Zero R
src✝¹ : One (Tropical R) := instOneTropical
src✝ : AddCommMonoid (Tropical R) := instAddCommMonoidTropical
⊢ untrop (NatCast.natCast (Nat.zero + 1)) = untrop (NatCast.natCast Nat.zero + 1)
[PROOFSTEP]
simp [Nat.cast]
[GOAL]
case succ
R : Type u
inst✝² : LinearOrder R
inst✝¹ : OrderTop R
inst✝ : Zero R
src✝¹ : One (Tropical R) := instOneTropical
src✝ : AddCommMonoid (Tropical R) := instAddCommMonoidTropical
n✝ : ℕ
⊢ untrop (NatCast.natCast (Nat.succ n✝ + 1)) = untrop (NatCast.natCast (Nat.succ n✝) + 1)
[PROOFSTEP]
simp [Nat.cast]
[GOAL]
R : Type u
inst✝ : AddMonoid R
src✝¹ : MulOneClass (Tropical R) := instMulOneClassTropical
src✝ : Semigroup (Tropical R) := instSemigroupTropical
x✝ : Tropical R
⊢ untrop ((fun n x => x ^ n) 0 x✝) = untrop 1
[PROOFSTEP]
simp
[GOAL]
R : Type u
inst✝ : AddGroup R
src✝ : Monoid (Tropical R) := instMonoidTropical
x✝¹ x✝ : Tropical R
⊢ untrop (x✝¹ / x✝) = untrop (x✝¹ * x✝⁻¹)
[PROOFSTEP]
simp [sub_eq_add_neg]
[GOAL]
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
h : y ≤ z
⊢ x + y ≤ x + z
[PROOFSTEP]
cases' le_total x y with hx hy
[GOAL]
case inl
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
h : y ≤ z
hx : x ≤ y
⊢ x + y ≤ x + z
[PROOFSTEP]
rw [add_eq_left hx, add_eq_left (hx.trans h)]
[GOAL]
case inr
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
h : y ≤ z
hy : y ≤ x
⊢ x + y ≤ x + z
[PROOFSTEP]
rw [add_eq_right hy]
[GOAL]
case inr
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
h : y ≤ z
hy : y ≤ x
⊢ y ≤ x + z
[PROOFSTEP]
cases' le_total x z with hx hx
[GOAL]
case inr.inl
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
h : y ≤ z
hy : y ≤ x
hx : x ≤ z
⊢ y ≤ x + z
[PROOFSTEP]
rwa [add_eq_left hx]
[GOAL]
case inr.inr
R : Type u
inst✝ : LinearOrder R
x y z : Tropical R
h : y ≤ z
hy : y ≤ x
hx : z ≤ x
⊢ y ≤ x + z
[PROOFSTEP]
rwa [add_eq_right hx]
[GOAL]
R : Type u
inst✝³ : LinearOrder R
inst✝² : AddMonoid R
inst✝¹ : CovariantClass R R (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass R R (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
x y : Tropical R
n : ℕ
⊢ (x + y) ^ n = x ^ n + y ^ n
[PROOFSTEP]
cases' le_total x y with h h
[GOAL]
case inl
R : Type u
inst✝³ : LinearOrder R
inst✝² : AddMonoid R
inst✝¹ : CovariantClass R R (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass R R (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
x y : Tropical R
n : ℕ
h : x ≤ y
⊢ (x + y) ^ n = x ^ n + y ^ n
[PROOFSTEP]
rw [add_eq_left h, add_eq_left (pow_le_pow_of_le_left' h _)]
[GOAL]
case inr
R : Type u
inst✝³ : LinearOrder R
inst✝² : AddMonoid R
inst✝¹ : CovariantClass R R (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass R R (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
x y : Tropical R
n : ℕ
h : y ≤ x
⊢ (x + y) ^ n = x ^ n + y ^ n
[PROOFSTEP]
rw [add_eq_right h, add_eq_right (pow_le_pow_of_le_left' h _)]
[GOAL]
R : Type u
inst✝ : LinearOrderedAddCommMonoidWithTop R
src✝³ : AddMonoidWithOne (Tropical R) := instAddMonoidWithOneTropical
src✝² : Distrib (Tropical R) := instDistribTropical
src✝¹ : AddCommMonoid (Tropical R) := instAddCommMonoidTropical
src✝ : CommMonoid (Tropical R) := instCommMonoidTropical
x✝ : Tropical R
⊢ untrop (0 * x✝) = untrop 0
[PROOFSTEP]
simp [top_add]
[GOAL]
R : Type u
inst✝ : LinearOrderedAddCommMonoidWithTop R
src✝³ : AddMonoidWithOne (Tropical R) := instAddMonoidWithOneTropical
src✝² : Distrib (Tropical R) := instDistribTropical
src✝¹ : AddCommMonoid (Tropical R) := instAddCommMonoidTropical
src✝ : CommMonoid (Tropical R) := instCommMonoidTropical
x✝ : Tropical R
⊢ untrop (x✝ * 0) = untrop 0
[PROOFSTEP]
simp [add_top]
[GOAL]
R✝ : Type u
inst✝² : LinearOrderedAddCommMonoidWithTop R✝
R : Type u_1
inst✝¹ : LinearOrder R
inst✝ : OrderTop R
x : Tropical R
n : ℕ
⊢ (n + 1) • x = x
[PROOFSTEP]
induction' n with n IH
[GOAL]
case zero
R✝ : Type u
inst✝² : LinearOrderedAddCommMonoidWithTop R✝
R : Type u_1
inst✝¹ : LinearOrder R
inst✝ : OrderTop R
x : Tropical R
⊢ (Nat.zero + 1) • x = x
[PROOFSTEP]
simp
[GOAL]
case succ
R✝ : Type u
inst✝² : LinearOrderedAddCommMonoidWithTop R✝
R : Type u_1
inst✝¹ : LinearOrder R
inst✝ : OrderTop R
x : Tropical R
n : ℕ
IH : (n + 1) • x = x
⊢ (Nat.succ n + 1) • x = x
[PROOFSTEP]
rw [add_nsmul, IH, one_nsmul, add_self]
[GOAL]
R✝ : Type u
inst✝¹ : LinearOrderedAddCommMonoidWithTop R✝
R : Type u_1
inst✝ : LinearOrderedAddCommMonoid R
a b : Tropical (WithTop R)
⊢ a * b = 0 ↔ a = 0 ∨ b = 0
[PROOFSTEP]
simp [← untrop_inj_iff, WithTop.add_eq_top]


[GOAL]
𝕜 : Type u_1
E : Type u_2
inst✝¹ : NormedField 𝕜
inst✝ : Norm E
a : 𝕜
f : 𝕜 → E
h : IsBoundedUnder (fun x x_1 => x ≤ x_1) (𝓝[{a}ᶜ] a) (norm ∘ f)
⊢ f =o[𝓝[{a}ᶜ] a] fun x => (x - a)⁻¹
[PROOFSTEP]
refine' (h.isBigO_const (one_ne_zero' ℝ)).trans_isLittleO (isLittleO_const_left.2 <| Or.inr _)
[GOAL]
𝕜 : Type u_1
E : Type u_2
inst✝¹ : NormedField 𝕜
inst✝ : Norm E
a : 𝕜
f : 𝕜 → E
h : IsBoundedUnder (fun x x_1 => x ≤ x_1) (𝓝[{a}ᶜ] a) (norm ∘ f)
⊢ Tendsto (norm ∘ fun x => (x - a)⁻¹) (𝓝[{a}ᶜ] a) atTop
[PROOFSTEP]
simp only [(· ∘ ·), norm_inv]
[GOAL]
𝕜 : Type u_1
E : Type u_2
inst✝¹ : NormedField 𝕜
inst✝ : Norm E
a : 𝕜
f : 𝕜 → E
h : IsBoundedUnder (fun x x_1 => x ≤ x_1) (𝓝[{a}ᶜ] a) (norm ∘ f)
⊢ Tendsto (fun x => ‖x - a‖⁻¹) (𝓝[{a}ᶜ] a) atTop
[PROOFSTEP]
exact (tendsto_norm_sub_self_punctured_nhds a).inv_tendsto_zero
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
⊢ (fun x => x ^ p / x ^ q) =ᶠ[atTop] fun x => x ^ (↑p - ↑q)
[PROOFSTEP]
apply (eventually_gt_atTop (0 : 𝕜)).mono fun x hx => _
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
⊢ ∀ (x : 𝕜), 0 < x → (fun x => x ^ p / x ^ q) x = (fun x => x ^ (↑p - ↑q)) x
[PROOFSTEP]
intro x hx
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
x : 𝕜
hx : 0 < x
⊢ (fun x => x ^ p / x ^ q) x = (fun x => x ^ (↑p - ↑q)) x
[PROOFSTEP]
simp [zpow_sub₀ hx.ne']
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
⊢ (fun x => x ^ p / x ^ q) =ᶠ[atBot] fun x => x ^ (↑p - ↑q)
[PROOFSTEP]
apply (eventually_lt_atBot (0 : 𝕜)).mono fun x hx => _
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
⊢ ∀ (x : 𝕜), x < 0 → (fun x => x ^ p / x ^ q) x = (fun x => x ^ (↑p - ↑q)) x
[PROOFSTEP]
intro x hx
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
x : 𝕜
hx : x < 0
⊢ (fun x => x ^ p / x ^ q) x = (fun x => x ^ (↑p - ↑q)) x
[PROOFSTEP]
simp [zpow_sub₀ hx.ne]
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
n : ℤ
hn : 0 < n
⊢ Tendsto (fun x => x ^ n) atTop atTop
[PROOFSTEP]
lift n to ℕ using hn.le
[GOAL]
case intro
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
n : ℕ
hn : 0 < ↑n
⊢ Tendsto (fun x => x ^ ↑n) atTop atTop
[PROOFSTEP]
simp only [zpow_ofNat]
[GOAL]
case intro
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
n : ℕ
hn : 0 < ↑n
⊢ Tendsto (fun x => x ^ n) atTop atTop
[PROOFSTEP]
exact tendsto_pow_atTop (Nat.cast_pos.mp hn).ne'
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
hpq : q < p
⊢ Tendsto (fun x => x ^ p / x ^ q) atTop atTop
[PROOFSTEP]
rw [tendsto_congr' pow_div_pow_eventuallyEq_atTop]
[GOAL]
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
hpq : q < p
⊢ Tendsto (fun x => x ^ (↑p - ↑q)) atTop atTop
[PROOFSTEP]
apply tendsto_zpow_atTop_atTop
[GOAL]
case hn
𝕜 : Type u_1
inst✝ : LinearOrderedField 𝕜
p q : ℕ
hpq : q < p
⊢ 0 < ↑p - ↑q
[PROOFSTEP]
linarith
[GOAL]
𝕜 : Type u_1
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : ℕ
hpq : p < q
⊢ Tendsto (fun x => x ^ p / x ^ q) atTop (𝓝 0)
[PROOFSTEP]
rw [tendsto_congr' pow_div_pow_eventuallyEq_atTop]
[GOAL]
𝕜 : Type u_1
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : ℕ
hpq : p < q
⊢ Tendsto (fun x => x ^ (↑p - ↑q)) atTop (𝓝 0)
[PROOFSTEP]
apply tendsto_zpow_atTop_zero
[GOAL]
case hn
𝕜 : Type u_1
inst✝² : LinearOrderedField 𝕜
inst✝¹ : TopologicalSpace 𝕜
inst✝ : OrderTopology 𝕜
p q : ℕ
hpq : p < q
⊢ ↑p - ↑q < 0
[PROOFSTEP]
linarith
[GOAL]
𝕜 : Type u_1
inst✝¹ : NormedLinearOrderedField 𝕜
inst✝ : OrderTopology 𝕜
p q : ℕ
hpq : p < q
⊢ (fun x => x ^ p) =o[atTop] fun x => x ^ q
[PROOFSTEP]
refine' (isLittleO_iff_tendsto' _).mpr (tendsto_pow_div_pow_atTop_zero hpq)
[GOAL]
𝕜 : Type u_1
inst✝¹ : NormedLinearOrderedField 𝕜
inst✝ : OrderTopology 𝕜
p q : ℕ
hpq : p < q
⊢ ∀ᶠ (x : 𝕜) in atTop, x ^ q = 0 → x ^ p = 0
[PROOFSTEP]
exact (eventually_gt_atTop 0).mono fun x hx hxq => (pow_ne_zero q hx.ne' hxq).elim
[GOAL]
𝕜 : Type u_1
inst✝ : NormedLinearOrderedField 𝕜
α : Type u_2
u v : α → 𝕜
l : Filter α
huv : u =O[l] v
hu : Tendsto (fun x => ‖u x‖) l atTop
⊢ Tendsto (fun x => ‖v x‖) l atTop
[PROOFSTEP]
rcases huv.exists_pos with ⟨c, hc, hcuv⟩
[GOAL]
case intro.intro
𝕜 : Type u_1
inst✝ : NormedLinearOrderedField 𝕜
α : Type u_2
u v : α → 𝕜
l : Filter α
huv : u =O[l] v
hu : Tendsto (fun x => ‖u x‖) l atTop
c : ℝ
hc : 0 < c
hcuv : IsBigOWith c l u v
⊢ Tendsto (fun x => ‖v x‖) l atTop
[PROOFSTEP]
rw [IsBigOWith] at hcuv
[GOAL]
case intro.intro
𝕜 : Type u_1
inst✝ : NormedLinearOrderedField 𝕜
α : Type u_2
u v : α → 𝕜
l : Filter α
huv : u =O[l] v
hu : Tendsto (fun x => ‖u x‖) l atTop
c : ℝ
hc : 0 < c
hcuv : ∀ᶠ (x : α) in l, ‖u x‖ ≤ c * ‖v x‖
⊢ Tendsto (fun x => ‖v x‖) l atTop
[PROOFSTEP]
convert Tendsto.atTop_div_const hc (tendsto_atTop_mono' l hcuv hu)
[GOAL]
case h.e'_3.h
𝕜 : Type u_1
inst✝ : NormedLinearOrderedField 𝕜
α : Type u_2
u v : α → 𝕜
l : Filter α
huv : u =O[l] v
hu : Tendsto (fun x => ‖u x‖) l atTop
c : ℝ
hc : 0 < c
hcuv : ∀ᶠ (x : α) in l, ‖u x‖ ≤ c * ‖v x‖
x✝ : α
⊢ ‖v x✝‖ = c * ‖v x✝‖ / c
[PROOFSTEP]
rw [mul_div_cancel_left _ hc.ne.symm]
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
⊢ (fun n => ∑ i in range n, f i) =o[atTop] fun n => ∑ i in range n, g i
[PROOFSTEP]
have A : ∀ i, ‖g i‖ = g i := fun i => Real.norm_of_nonneg (hg i)
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
⊢ (fun n => ∑ i in range n, f i) =o[atTop] fun n => ∑ i in range n, g i
[PROOFSTEP]
have B : ∀ n, ‖∑ i in range n, g i‖ = ∑ i in range n, g i := fun n => by rwa [Real.norm_eq_abs, abs_sum_of_nonneg']
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
n : ℕ
⊢ ‖∑ i in range n, g i‖ = ∑ i in range n, g i
[PROOFSTEP]
rwa [Real.norm_eq_abs, abs_sum_of_nonneg']
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
⊢ (fun n => ∑ i in range n, f i) =o[atTop] fun n => ∑ i in range n, g i
[PROOFSTEP]
apply isLittleO_iff.2 fun ε εpos => _
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
⊢ ∀ (ε : ℝ), 0 < ε → ∀ᶠ (x : ℕ) in atTop, ‖∑ i in range x, f i‖ ≤ ε * ‖∑ i in range x, g i‖
[PROOFSTEP]
intro ε εpos
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
⊢ ∀ᶠ (x : ℕ) in atTop, ‖∑ i in range x, f i‖ ≤ ε * ‖∑ i in range x, g i‖
[PROOFSTEP]
obtain ⟨N, hN⟩ : ∃ N : ℕ, ∀ b : ℕ, N ≤ b → ‖f b‖ ≤ ε / 2 * g b := by
  simpa only [A, eventually_atTop] using isLittleO_iff.mp h (half_pos εpos)
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
⊢ ∃ N, ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
[PROOFSTEP]
simpa only [A, eventually_atTop] using isLittleO_iff.mp h (half_pos εpos)
[GOAL]
case intro
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
⊢ ∀ᶠ (x : ℕ) in atTop, ‖∑ i in range x, f i‖ ≤ ε * ‖∑ i in range x, g i‖
[PROOFSTEP]
have : (fun _ : ℕ => ∑ i in range N, f i) =o[atTop] fun n : ℕ => ∑ i in range n, g i :=
  by
  apply isLittleO_const_left.2
  exact Or.inr (h'g.congr fun n => (B n).symm)
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
⊢ (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
[PROOFSTEP]
apply isLittleO_const_left.2
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
⊢ ∑ i in range N, f i = 0 ∨ Tendsto (norm ∘ fun n => ∑ i in range n, g i) atTop atTop
[PROOFSTEP]
exact Or.inr (h'g.congr fun n => (B n).symm)
[GOAL]
case intro
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
⊢ ∀ᶠ (x : ℕ) in atTop, ‖∑ i in range x, f i‖ ≤ ε * ‖∑ i in range x, g i‖
[PROOFSTEP]
filter_upwards [isLittleO_iff.1 this (half_pos εpos), Ici_mem_atTop N] with n hn Nn
[GOAL]
case h
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ‖∑ i in range n, f i‖ ≤ ε * ‖∑ i in range n, g i‖
[PROOFSTEP]
calc
  ‖∑ i in range n, f i‖ = ‖(∑ i in range N, f i) + ∑ i in Ico N n, f i‖ := by rw [sum_range_add_sum_Ico _ Nn]
  _ ≤ ‖∑ i in range N, f i‖ + ‖∑ i in Ico N n, f i‖ := (norm_add_le _ _)
  _ ≤ ‖∑ i in range N, f i‖ + ∑ i in Ico N n, ε / 2 * g i :=
    (add_le_add le_rfl (norm_sum_le_of_le _ fun i hi => hN _ (mem_Ico.1 hi).1))
  _ ≤ ‖∑ i in range N, f i‖ + ∑ i in range n, ε / 2 * g i :=
    by
    gcongr
    apply sum_le_sum_of_subset_of_nonneg
    · rw [range_eq_Ico]
      exact Ico_subset_Ico (zero_le _) le_rfl
    · intro i _ _
      exact mul_nonneg (half_pos εpos).le (hg i)
  _ ≤ ε / 2 * ‖∑ i in range n, g i‖ + ε / 2 * ∑ i in range n, g i := by rw [← mul_sum]; gcongr
  _ = ε * ‖∑ i in range n, g i‖ := by
    simp only [B]
    ring
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ‖∑ i in range n, f i‖ = ‖∑ i in range N, f i + ∑ i in Ico N n, f i‖
[PROOFSTEP]
rw [sum_range_add_sum_Ico _ Nn]
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ‖∑ i in range N, f i‖ + ∑ i in Ico N n, ε / 2 * g i ≤ ‖∑ i in range N, f i‖ + ∑ i in range n, ε / 2 * g i
[PROOFSTEP]
gcongr
[GOAL]
case bc
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ∑ i in Ico N n, ε / 2 * g i ≤ ∑ i in range n, ε / 2 * g i
[PROOFSTEP]
apply sum_le_sum_of_subset_of_nonneg
[GOAL]
case bc.h
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ Ico N n ⊆ range n
[PROOFSTEP]
rw [range_eq_Ico]
[GOAL]
case bc.h
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ Ico N n ⊆ Ico 0 n
[PROOFSTEP]
exact Ico_subset_Ico (zero_le _) le_rfl
[GOAL]
case bc.hf
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ∀ (i : ℕ), i ∈ range n → ¬i ∈ Ico N n → 0 ≤ ε / 2 * g i
[PROOFSTEP]
intro i _ _
[GOAL]
case bc.hf
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
i : ℕ
a✝¹ : i ∈ range n
a✝ : ¬i ∈ Ico N n
⊢ 0 ≤ ε / 2 * g i
[PROOFSTEP]
exact mul_nonneg (half_pos εpos).le (hg i)
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ‖∑ i in range N, f i‖ + ∑ i in range n, ε / 2 * g i ≤ ε / 2 * ‖∑ i in range n, g i‖ + ε / 2 * ∑ i in range n, g i
[PROOFSTEP]
rw [← mul_sum]
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ‖∑ i in range N, f i‖ + ε / 2 * ∑ x in range n, g x ≤ ε / 2 * ‖∑ i in range n, g i‖ + ε / 2 * ∑ i in range n, g i
[PROOFSTEP]
gcongr
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ε / 2 * ‖∑ i in range n, g i‖ + ε / 2 * ∑ i in range n, g i = ε * ‖∑ i in range n, g i‖
[PROOFSTEP]
simp only [B]
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
g : ℕ → ℝ
h : f =o[atTop] g
hg : 0 ≤ g
h'g : Tendsto (fun n => ∑ i in range n, g i) atTop atTop
A : ∀ (i : ℕ), ‖g i‖ = g i
B : ∀ (n : ℕ), ‖∑ i in range n, g i‖ = ∑ i in range n, g i
ε : ℝ
εpos : 0 < ε
N : ℕ
hN : ∀ (b : ℕ), N ≤ b → ‖f b‖ ≤ ε / 2 * g b
this : (fun x => ∑ i in range N, f i) =o[atTop] fun n => ∑ i in range n, g i
n : ℕ
hn : ‖∑ i in range N, f i‖ ≤ ε / 2 * ‖∑ i in range n, g i‖
Nn : n ∈ Set.Ici N
⊢ ε / 2 * ∑ i in range n, g i + ε / 2 * ∑ i in range n, g i = ε * ∑ i in range n, g i
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
h : Tendsto f atTop (𝓝 0)
⊢ (fun n => ∑ i in range n, f i) =o[atTop] fun n => ↑n
[PROOFSTEP]
have := ((isLittleO_one_iff ℝ).2 h).sum_range fun i => zero_le_one
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
h : Tendsto f atTop (𝓝 0)
this :
  Tendsto (fun n => ∑ i in range n, 1) atTop atTop → (fun n => ∑ i in range n, f i) =o[atTop] fun n => ∑ i in range n, 1
⊢ (fun n => ∑ i in range n, f i) =o[atTop] fun n => ↑n
[PROOFSTEP]
simp only [sum_const, card_range, Nat.smul_one_eq_coe] at this
[GOAL]
α : Type u_1
inst✝ : NormedAddCommGroup α
f : ℕ → α
h : Tendsto f atTop (𝓝 0)
this : Tendsto (fun n => ↑n) atTop atTop → (fun n => ∑ i in range n, f i) =o[atTop] fun n => ↑n
⊢ (fun n => ∑ i in range n, f i) =o[atTop] fun n => ↑n
[PROOFSTEP]
exact this tendsto_nat_cast_atTop_atTop
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
⊢ Tendsto (fun n => (↑n)⁻¹ • ∑ i in range n, u i) atTop (𝓝 l)
[PROOFSTEP]
rw [← tendsto_sub_nhds_zero_iff, ← isLittleO_one_iff ℝ]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
⊢ (fun n => (↑n)⁻¹ • ∑ i in range n, u i - l) =o[atTop] fun _x => 1
[PROOFSTEP]
have := Asymptotics.isLittleO_sum_range_of_tendsto_zero (tendsto_sub_nhds_zero_iff.2 h)
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun n => (↑n)⁻¹ • ∑ i in range n, u i - l) =o[atTop] fun _x => 1
[PROOFSTEP]
apply ((isBigO_refl (fun n : ℕ => (n : ℝ)⁻¹) atTop).smul_isLittleO this).congr' _ _
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ∑ i in range x, (u i - l)) =ᶠ[atTop] fun n => (↑n)⁻¹ • ∑ i in range n, u i - l
[PROOFSTEP]
filter_upwards [Ici_mem_atTop 1] with n npos
[GOAL]
case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
⊢ (↑n)⁻¹ • ∑ i in range n, (u i - l) = (↑n)⁻¹ • ∑ i in range n, u i - l
[PROOFSTEP]
have nposℝ : (0 : ℝ) < n := Nat.cast_pos.2 npos
[GOAL]
case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • ∑ i in range n, (u i - l) = (↑n)⁻¹ • ∑ i in range n, u i - l
[PROOFSTEP]
simp only [smul_sub, sum_sub_distrib, sum_const, card_range, sub_right_inj]
[GOAL]
case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • n • l = l
[PROOFSTEP]
rw [nsmul_eq_smul_cast ℝ, smul_smul, inv_mul_cancel nposℝ.ne', one_smul]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ↑x) =ᶠ[atTop] fun _x => 1
[PROOFSTEP]
filter_upwards [Ici_mem_atTop 1] with n npos
[GOAL]
case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
⊢ (↑n)⁻¹ • ↑n = 1
[PROOFSTEP]
have nposℝ : (0 : ℝ) < n := Nat.cast_pos.2 npos
[GOAL]
case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i in range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • ↑n = 1
[PROOFSTEP]
rw [Algebra.id.smul_eq_mul, inv_mul_cancel nposℝ.ne']