l3lab/ntp-mathlib huggingface dataset:
theorem AddValuation.map_mul (x y : ℚ_[p]) :
    addValuationDef (x * y : ℚ_[p]) = addValuationDef x + addValuationDef y := by
  simp only [addValuationDef]
  by_cases hx : x = 0
  · rw [hx, if_pos (Eq.refl _), zero_mul, if_pos (Eq.refl _), WithTop.top_add]
  · by_cases hy : y = 0
    · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hx : ¬x = 0
hy : y = 0
⊢ (if x * y = 0 then ⊤ else ↑(valuation (x * y))) =
    (if x = 0 then ⊤ else ↑(valuation x)) + if y = 0 then ⊤ else ↑(valuation y)

Next tactic:
rw [hy, if_pos (Eq.refl _), mul_zero, if_pos (Eq.refl _), WithTop.add_top]
theorem AddValuation.map_mul (x y : ℚ_[p]) :
    addValuationDef (x * y : ℚ_[p]) = addValuationDef x + addValuationDef y := by
  simp only [addValuationDef]
  by_cases hx : x = 0
  · rw [hx, if_pos (Eq.refl _), zero_mul, if_pos (Eq.refl _), WithTop.top_add]
  · by_cases hy : y = 0
    · rw [hy, if_pos (Eq.refl _), mul_zero, if_pos (Eq.refl _), WithTop.add_top]
    · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hx : ¬x = 0
hy : ¬y = 0
⊢ (if x * y = 0 then ⊤ else ↑(valuation (x * y))) =
    (if x = 0 then ⊤ else ↑(valuation x)) + if y = 0 then ⊤ else ↑(valuation y)

Next tactic:
rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithTop.coe_add, WithTop.coe_eq_coe,
        valuation_map_mul hx hy]
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
⊢ min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y)

Next tactic:
simp only [addValuationDef]
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
by_cases hxy : x + y = 0
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : x + y = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
rw [hxy, if_pos (Eq.refl _)]
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : x + y = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤ ⊤

Next tactic:
exact le_top
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
by_cases hx : x = 0
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : x = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
      

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : x = 0
⊢ (if y = 0 then ⊤ else ↑(valuation y)) ≤ ⊤

Next tactic:
exact le_top
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
      exact le_top
    · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : ¬x = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
by_cases hy : y = 0
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
      exact le_top
    · by_cases hy : y = 0
      · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : ¬x = 0
hy : y = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
rw [hy, if_pos (Eq.refl _), min_eq_left, add_zero]
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
      exact le_top
    · by_cases hy : y = 0
      · rw [hy, if_pos (Eq.refl _), min_eq_left, add_zero]
        

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : ¬x = 0
hy : y = 0
⊢ (if x = 0 then ⊤ else ↑(valuation x)) ≤ ⊤

Next tactic:
exact le_top
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
      exact le_top
    · by_cases hy : y = 0
      · rw [hy, if_pos (Eq.refl _), min_eq_left, add_zero]
        exact le_top
      · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : ¬x = 0
hy : ¬y = 0
⊢ min (if x = 0 then ⊤ else ↑(valuation x)) (if y = 0 then ⊤ else ↑(valuation y)) ≤
    if x + y = 0 then ⊤ else ↑(valuation (x + y))

Next tactic:
rw [if_neg hx, if_neg hy, if_neg hxy, ← WithTop.coe_min, WithTop.coe_le_coe]
theorem AddValuation.map_add (x y : ℚ_[p]) :
    min (addValuationDef x) (addValuationDef y) ≤ addValuationDef (x + y : ℚ_[p]) := by
  simp only [addValuationDef]
  by_cases hxy : x + y = 0
  · rw [hxy, if_pos (Eq.refl _)]
    exact le_top
  · by_cases hx : x = 0
    · rw [hx, if_pos (Eq.refl _), min_eq_right, zero_add]
      exact le_top
    · by_cases hy : y = 0
      · rw [hy, if_pos (Eq.refl _), min_eq_left, add_zero]
        exact le_top
      · rw [if_neg hx, if_neg hy, if_neg hxy, ← WithTop.coe_min, WithTop.coe_le_coe]
        

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x y : ℚ_[p]
hxy : ¬x + y = 0
hx : ¬x = 0
hy : ¬y = 0
⊢ min (valuation x) (valuation y) ≤ valuation (x + y)

Next tactic:
exact valuation_map_add hxy
@[simp]
theorem addValuation.apply {x : ℚ_[p]} (hx : x ≠ 0) :
    Padic.addValuation x = (x.valuation : WithTop ℤ) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : x ≠ 0
⊢ addValuation x = ↑(valuation x)

Next tactic:
simp only [Padic.addValuation, AddValuation.of_apply, addValuationDef, if_neg hx]
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
⊢ ‖x‖ ≤ ↑p ^ n ↔ ‖x‖ < ↑p ^ (n + 1)

Next tactic:
have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
⊢ ∀ (n : ℤ), 0 < ↑p ^ n

Next tactic:
apply Nat.zpow_pos_of_pos
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    

Proof state:
case h
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
⊢ 0 < p

Next tactic:
exact hp.1.pos
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
aux : ∀ (n : ℤ), 0 < ↑p ^ n
⊢ ‖x‖ ≤ ↑p ^ n ↔ ‖x‖ < ↑p ^ (n + 1)

Next tactic:
by_cases hx0 : x = 0
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
  by_cases hx0 : x = 0
  · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
aux : ∀ (n : ℤ), 0 < ↑p ^ n
hx0 : x = 0
⊢ ‖x‖ ≤ ↑p ^ n ↔ ‖x‖ < ↑p ^ (n + 1)

Next tactic:
simp [hx0, norm_zero, aux, le_of_lt (aux _)]
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
  by_cases hx0 : x = 0
  · simp [hx0, norm_zero, aux, le_of_lt (aux _)]
  

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
aux : ∀ (n : ℤ), 0 < ↑p ^ n
hx0 : ¬x = 0
⊢ ‖x‖ ≤ ↑p ^ n ↔ ‖x‖ < ↑p ^ (n + 1)

Next tactic:
rw [norm_eq_pow_val hx0]
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
  by_cases hx0 : x = 0
  · simp [hx0, norm_zero, aux, le_of_lt (aux _)]
  rw [norm_eq_pow_val hx0]
  

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
aux : ∀ (n : ℤ), 0 < ↑p ^ n
hx0 : ¬x = 0
⊢ ↑p ^ (-valuation x) ≤ ↑p ^ n ↔ ↑p ^ (-valuation x) < ↑p ^ (n + 1)

Next tactic:
have h1p : 1 < (p : ℝ) := mod_cast hp.1.one_lt
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
  by_cases hx0 : x = 0
  · simp [hx0, norm_zero, aux, le_of_lt (aux _)]
  rw [norm_eq_pow_val hx0]
  have h1p : 1 < (p : ℝ) := mod_cast hp.1.one_lt
  

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
aux : ∀ (n : ℤ), 0 < ↑p ^ n
hx0 : ¬x = 0
h1p : 1 < ↑p
⊢ ↑p ^ (-valuation x) ≤ ↑p ^ n ↔ ↑p ^ (-valuation x) < ↑p ^ (n + 1)

Next tactic:
have H := zpow_strictMono h1p
theorem norm_le_pow_iff_norm_lt_pow_add_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ ≤ (p : ℝ) ^ n ↔ ‖x‖ < (p : ℝ) ^ (n + 1) := by
  have aux : ∀ n : ℤ, 0 < ((p : ℝ) ^ n) := by
    apply Nat.zpow_pos_of_pos
    exact hp.1.pos
  by_cases hx0 : x = 0
  · simp [hx0, norm_zero, aux, le_of_lt (aux _)]
  rw [norm_eq_pow_val hx0]
  have h1p : 1 < (p : ℝ) := mod_cast hp.1.one_lt
  have H := zpow_strictMono h1p
  

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
aux : ∀ (n : ℤ), 0 < ↑p ^ n
hx0 : ¬x = 0
h1p : 1 < ↑p
H : StrictMono fun x => ↑p ^ x
⊢ ↑p ^ (-valuation x) ≤ ↑p ^ n ↔ ↑p ^ (-valuation x) < ↑p ^ (n + 1)

Next tactic:
rw [H.le_iff_le, H.lt_iff_lt, Int.lt_add_one_iff]
theorem norm_lt_pow_iff_norm_le_pow_sub_one (x : ℚ_[p]) (n : ℤ) :
    ‖x‖ < (p : ℝ) ^ n ↔ ‖x‖ ≤ (p : ℝ) ^ (n - 1) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
n : ℤ
⊢ ‖x‖ < ↑p ^ n ↔ ‖x‖ ≤ ↑p ^ (n - 1)

Next tactic:
rw [norm_le_pow_iff_norm_lt_pow_add_one, sub_add_cancel]
theorem norm_le_one_iff_val_nonneg (x : ℚ_[p]) : ‖x‖ ≤ 1 ↔ 0 ≤ x.valuation := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
⊢ ‖x‖ ≤ 1 ↔ 0 ≤ valuation x

Next tactic:
by_cases hx : x = 0
theorem norm_le_one_iff_val_nonneg (x : ℚ_[p]) : ‖x‖ ≤ 1 ↔ 0 ≤ x.valuation := by
  by_cases hx : x = 0
  · 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : x = 0
⊢ ‖x‖ ≤ 1 ↔ 0 ≤ valuation x

Next tactic:
simp only [hx, norm_zero, valuation_zero, zero_le_one, le_refl]
theorem norm_le_one_iff_val_nonneg (x : ℚ_[p]) : ‖x‖ ≤ 1 ↔ 0 ≤ x.valuation := by
  by_cases hx : x = 0
  · simp only [hx, norm_zero, valuation_zero, zero_le_one, le_refl]
  · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬x = 0
⊢ ‖x‖ ≤ 1 ↔ 0 ≤ valuation x

Next tactic:
rw [norm_eq_pow_val hx, ← zpow_zero (p : ℝ), zpow_le_iff_le, Right.neg_nonpos_iff]
theorem norm_le_one_iff_val_nonneg (x : ℚ_[p]) : ‖x‖ ≤ 1 ↔ 0 ≤ x.valuation := by
  by_cases hx : x = 0
  · simp only [hx, norm_zero, valuation_zero, zero_le_one, le_refl]
  · rw [norm_eq_pow_val hx, ← zpow_zero (p : ℝ), zpow_le_iff_le, Right.neg_nonpos_iff]
    

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
x : ℚ_[p]
hx : ¬x = 0
⊢ 1 < ↑p

Next tactic:
exact Nat.one_lt_cast.2 (Nat.Prime.one_lt' p).1
@[simp]
lemma isoAdd_hom_app {a b : A}
    (e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a)
    (e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b) (X : C) :
      (CommShift.isoAdd e₁ e₂).hom.app X =
        F.map ((shiftFunctorAdd C a b).hom.app X) ≫ e₂.hom.app ((shiftFunctor C a).obj X) ≫
          (shiftFunctor D b).map (e₁.hom.app X) ≫ (shiftFunctorAdd D a b).inv.app (F.obj X) := by
  

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_6, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.20958, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝³ : AddMonoid A
inst✝² : HasShift C A
inst✝¹ : HasShift D A
inst✝ : HasShift E A
a b : A
e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a
e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b
X : C
⊢ (isoAdd e₁ e₂).hom.app X =
    F.map ((shiftFunctorAdd C a b).hom.app X) ≫
      e₂.hom.app ((shiftFunctor C a).obj X) ≫
        (shiftFunctor D b).map (e₁.hom.app X) ≫ (shiftFunctorAdd D a b).inv.app (F.obj X)

Next tactic:
simp only [isoAdd, isoAdd'_hom_app, shiftFunctorAdd'_eq_shiftFunctorAdd]
@[simp]
lemma isoAdd_inv_app {a b : A}
    (e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a)
    (e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b) (X : C) :
      (CommShift.isoAdd e₁ e₂).inv.app X = (shiftFunctorAdd D a b).hom.app (F.obj X) ≫
        (shiftFunctor D b).map (e₁.inv.app X) ≫ e₂.inv.app ((shiftFunctor C a).obj X) ≫
        F.map ((shiftFunctorAdd C a b).inv.app X) := by
  

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_6, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.24226, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝³ : AddMonoid A
inst✝² : HasShift C A
inst✝¹ : HasShift D A
inst✝ : HasShift E A
a b : A
e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a
e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b
X : C
⊢ (isoAdd e₁ e₂).inv.app X =
    (shiftFunctorAdd D a b).hom.app (F.obj X) ≫
      (shiftFunctor D b).map (e₁.inv.app X) ≫
        e₂.inv.app ((shiftFunctor C a).obj X) ≫ F.map ((shiftFunctorAdd C a b).inv.app X)

Next tactic:
simp only [isoAdd, isoAdd'_inv_app, shiftFunctorAdd'_eq_shiftFunctorAdd]
lemma commShiftIso_add' {a b c : A} (h : a + b = c) :
    F.commShiftIso c = CommShift.isoAdd' h (F.commShiftIso a) (F.commShiftIso b) := by
  

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁷ : Category.{u_6, u_1} C
inst✝⁶ : Category.{u_5, u_2} D
inst✝⁵ : Category.{?u.38740, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝⁴ : AddMonoid A
inst✝³ : HasShift C A
inst✝² : HasShift D A
inst✝¹ : HasShift E A
inst✝ : CommShift F A
a b c : A
h : a + b = c
⊢ commShiftIso F c = CommShift.isoAdd' h (commShiftIso F a) (commShiftIso F b)

Next tactic:
subst h
lemma commShiftIso_add' {a b c : A} (h : a + b = c) :
    F.commShiftIso c = CommShift.isoAdd' h (F.commShiftIso a) (F.commShiftIso b) := by
  subst h
  

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁷ : Category.{u_6, u_1} C
inst✝⁶ : Category.{u_5, u_2} D
inst✝⁵ : Category.{?u.38740, u_3} E
F : C ⥤ D
G : D ⥤ E
A : Type u_4
inst✝⁴ : AddMonoid A
inst✝³ : HasShift C A
inst✝² : HasShift D A
inst✝¹ : HasShift E A
inst✝ : CommShift F A
a b : A
⊢ commShiftIso F (a + b) = CommShift.isoAdd' (_ : a + b = a + b) (commShiftIso F a) (commShiftIso F b)

Next tactic:
simp only [commShiftIso_add, CommShift.isoAdd]
noncomputable instance : NormedAddCommGroup ℍ :=
  @InnerProductSpace.Core.toNormedAddCommGroup ℝ ℍ _ _ _
    { toInner := inferInstance
      conj_symm := fun x y => by 

Proof state:
x y : ℍ
⊢ (starRingEnd ℝ) (inner y x) = inner x y

Next tactic:
simp [inner_def, mul_comm]
noncomputable instance : NormedAddCommGroup ℍ :=
  @InnerProductSpace.Core.toNormedAddCommGroup ℝ ℍ _ _ _
    { toInner := inferInstance
      conj_symm := fun x y => by simp [inner_def, mul_comm]
      nonneg_re := fun x => normSq_nonneg
      definite := fun x => normSq_eq_zero.1
      add_left := fun x y z => by 

Proof state:
x y z : ℍ
⊢ inner (x + y) z = inner x z + inner y z

Next tactic:
simp only [inner_def, add_mul, add_re]
noncomputable instance : NormedAddCommGroup ℍ :=
  @InnerProductSpace.Core.toNormedAddCommGroup ℝ ℍ _ _ _
    { toInner := inferInstance
      conj_symm := fun x y => by simp [inner_def, mul_comm]
      nonneg_re := fun x => normSq_nonneg
      definite := fun x => normSq_eq_zero.1
      add_left := fun x y z => by simp only [inner_def, add_mul, add_re]
      smul_left := fun x y r => by 

Proof state:
x y : ℍ
r : ℝ
⊢ inner (r • x) y = (starRingEnd ℝ) r * inner x y

Next tactic:
simp [inner_def]
theorem normSq_eq_norm_mul_self (a : ℍ) : normSq a = ‖a‖ * ‖a‖ := by
  

Proof state:
a : ℍ
⊢ normSq a = ‖a‖ * ‖a‖

Next tactic:
rw [← inner_self, real_inner_self_eq_norm_mul_norm]
instance : NormOneClass ℍ :=
  ⟨by 

Proof state:
⊢ ‖1‖ = 1

Next tactic:
rw [norm_eq_sqrt_real_inner, inner_self, normSq.map_one, Real.sqrt_one]
@[simp, norm_cast]
theorem norm_coe (a : ℝ) : ‖(a : ℍ)‖ = ‖a‖ := by
  

Proof state:
a : ℝ
⊢ ‖↑a‖ = ‖a‖

Next tactic:
rw [norm_eq_sqrt_real_inner, inner_self, normSq_coe, Real.sqrt_sq_eq_abs, Real.norm_eq_abs]
@[simp, nolint simpNF] -- Porting note: simp cannot prove this
theorem norm_star (a : ℍ) : ‖star a‖ = ‖a‖ := by
  

Proof state:
a : ℍ
⊢ ‖star a‖ = ‖a‖

Next tactic:
simp_rw [norm_eq_sqrt_real_inner, inner_self, normSq_star]
noncomputable instance : NormedDivisionRing ℍ where
  dist_eq _ _ := rfl
  norm_mul' a b := by
    

Proof state:
a b : ℍ
⊢ ‖a * b‖ = ‖a‖ * ‖b‖

Next tactic:
simp only [norm_eq_sqrt_real_inner, inner_self, normSq.map_mul]
noncomputable instance : NormedDivisionRing ℍ where
  dist_eq _ _ := rfl
  norm_mul' a b := by
    simp only [norm_eq_sqrt_real_inner, inner_self, normSq.map_mul]
    

Proof state:
a b : ℍ
⊢ Real.sqrt (normSq a * normSq b) = Real.sqrt (normSq a) * Real.sqrt (normSq b)

Next tactic:
exact Real.sqrt_mul normSq_nonneg _
@[simp, norm_cast]
theorem coeComplex_add (z w : ℂ) : ↑(z + w) = (z + w : ℍ) := by 

Proof state:
z w : ℂ
⊢ ↑(z + w) = ↑z + ↑w

Next tactic:
ext
@[simp, norm_cast]
theorem coeComplex_add (z w : ℂ) : ↑(z + w) = (z + w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z + w)).re = (↑z + ↑w).re

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_add (z w : ℂ) : ↑(z + w) = (z + w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z + w)).imI = (↑z + ↑w).imI

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_add (z w : ℂ) : ↑(z + w) = (z + w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z + w)).imJ = (↑z + ↑w).imJ

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_add (z w : ℂ) : ↑(z + w) = (z + w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z + w)).imK = (↑z + ↑w).imK

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_mul (z w : ℂ) : ↑(z * w) = (z * w : ℍ) := by 

Proof state:
z w : ℂ
⊢ ↑(z * w) = ↑z * ↑w

Next tactic:
ext
@[simp, norm_cast]
theorem coeComplex_mul (z w : ℂ) : ↑(z * w) = (z * w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z * w)).re = (↑z * ↑w).re

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_mul (z w : ℂ) : ↑(z * w) = (z * w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z * w)).imI = (↑z * ↑w).imI

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_mul (z w : ℂ) : ↑(z * w) = (z * w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z * w)).imJ = (↑z * ↑w).imJ

Next tactic:
simp
@[simp, norm_cast]
theorem coeComplex_mul (z w : ℂ) : ↑(z * w) = (z * w : ℍ) := by ext <;> 

Proof state:
case a
z w : ℂ
⊢ (↑(z * w)).imK = (↑z * ↑w).imK

Next tactic:
simp
@[simp, norm_cast, nolint simpNF] -- Porting note: simp cannot prove this
theorem coe_real_complex_mul (r : ℝ) (z : ℂ) : (r • z : ℍ) = ↑r * ↑z := by 

Proof state:
r : ℝ
z : ℂ
⊢ r • ↑z = ↑r * ↑z

Next tactic:
ext
@[simp, norm_cast, nolint simpNF] -- Porting note: simp cannot prove this
theorem coe_real_complex_mul (r : ℝ) (z : ℂ) : (r • z : ℍ) = ↑r * ↑z := by ext <;> 

Proof state:
case a
r : ℝ
z : ℂ
⊢ (r • ↑z).re = (↑r * ↑z).re

Next tactic:
simp
@[simp, norm_cast, nolint simpNF] -- Porting note: simp cannot prove this
theorem coe_real_complex_mul (r : ℝ) (z : ℂ) : (r • z : ℍ) = ↑r * ↑z := by ext <;> 

Proof state:
case a
r : ℝ
z : ℂ
⊢ (r • ↑z).imI = (↑r * ↑z).imI

Next tactic:
simp
@[simp, norm_cast, nolint simpNF] -- Porting note: simp cannot prove this
theorem coe_real_complex_mul (r : ℝ) (z : ℂ) : (r • z : ℍ) = ↑r * ↑z := by ext <;> 

Proof state:
case a
r : ℝ
z : ℂ
⊢ (r • ↑z).imJ = (↑r * ↑z).imJ

Next tactic:
simp
@[simp, norm_cast, nolint simpNF] -- Porting note: simp cannot prove this
theorem coe_real_complex_mul (r : ℝ) (z : ℂ) : (r • z : ℍ) = ↑r * ↑z := by ext <;> 

Proof state:
case a
r : ℝ
z : ℂ
⊢ (r • ↑z).imK = (↑r * ↑z).imK

Next tactic:
simp
/-- The norm of the components as a euclidean vector equals the norm of the quaternion. -/
theorem norm_piLp_equiv_symm_equivTuple (x : ℍ) :
    ‖(WithLp.equiv 2 (Fin 4 → _)).symm (equivTuple ℝ x)‖ = ‖x‖ := by
  

Proof state:
x : ℍ
⊢ ‖(WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x)‖ = ‖x‖

Next tactic:
rw [norm_eq_sqrt_real_inner, norm_eq_sqrt_real_inner, inner_self, normSq_def', PiLp.inner_apply,
    Fin.sum_univ_four]
/-- The norm of the components as a euclidean vector equals the norm of the quaternion. -/
theorem norm_piLp_equiv_symm_equivTuple (x : ℍ) :
    ‖(WithLp.equiv 2 (Fin 4 → _)).symm (equivTuple ℝ x)‖ = ‖x‖ := by
  rw [norm_eq_sqrt_real_inner, norm_eq_sqrt_real_inner, inner_self, normSq_def', PiLp.inner_apply,
    Fin.sum_univ_four]
  

Proof state:
x : ℍ
⊢ Real.sqrt
      (inner ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 0)
              ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 0) +
            inner ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 1)
              ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 1) +
          inner ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 2)
            ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 2) +
        inner ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 3)
          ((WithLp.equiv 2 (Fin 4 → ℝ)).symm ((equivTuple ℝ) x) 3)) =
    Real.sqrt (x.re ^ 2 + x.imI ^ 2 + x.imJ ^ 2 + x.imK ^ 2)

Next tactic:
simp_rw [IsROrC.inner_apply, starRingEnd_apply, star_trivial, ← sq]