l3lab/ntp-mathlib huggingface dataset:
/-- `succ` commutes with `predAbove`. -/
@[simp]
theorem succ_predAbove_succ {n : ℕ} (a : Fin n) (b : Fin (n + 1)) :
    a.succ.predAbove b.succ = (a.predAbove b).succ := by
  obtain h₁ | h₂ := lt_or_le (castSucc a) b
  · rw [Fin.predAbove_above _ _ h₁, Fin.succ_pred, Fin.predAbove_above, Fin.pred_succ]
    simpa only [lt_iff_val_lt_val, coe_castSucc, val_succ, add_lt_add_iff_right] using
      h₁
  · cases' n with n
    · exfalso
      exact not_lt_zero' a.is_lt
    · rw [Fin.predAbove_below a b h₂,
        Fin.predAbove_below a.succ b.succ
          (by
            simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right]
              using h₂)]
      ext
      have h₀ : (b : ℕ) < n + 1 := by
        simp only [le_iff_val_le_val, coe_castSucc] at h₂
        

Proof state:
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : ↑b ≤ ↑a
⊢ ↑b < n + 1

Next tactic:
simpa only [lt_succ_iff] using h₂.trans a.is_le
/-- `succ` commutes with `predAbove`. -/
@[simp]
theorem succ_predAbove_succ {n : ℕ} (a : Fin n) (b : Fin (n + 1)) :
    a.succ.predAbove b.succ = (a.predAbove b).succ := by
  obtain h₁ | h₂ := lt_or_le (castSucc a) b
  · rw [Fin.predAbove_above _ _ h₁, Fin.succ_pred, Fin.predAbove_above, Fin.pred_succ]
    simpa only [lt_iff_val_lt_val, coe_castSucc, val_succ, add_lt_add_iff_right] using
      h₁
  · cases' n with n
    · exfalso
      exact not_lt_zero' a.is_lt
    · rw [Fin.predAbove_below a b h₂,
        Fin.predAbove_below a.succ b.succ
          (by
            simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right]
              using h₂)]
      ext
      have h₀ : (b : ℕ) < n + 1 := by
        simp only [le_iff_val_le_val, coe_castSucc] at h₂
        simpa only [lt_succ_iff] using h₂.trans a.is_le
      

Proof state:
case inr.succ.h
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ castSucc a
h₀ : ↑b < n + 1
⊢ ↑(castPred (succ b)) = ↑(succ (castPred b))

Next tactic:
have h₁ : (b.succ : ℕ) < n + 2 := by
        rw [← Nat.succ_lt_succ_iff] at h₀
        simpa only [val_succ] using h₀
/-- `succ` commutes with `predAbove`. -/
@[simp]
theorem succ_predAbove_succ {n : ℕ} (a : Fin n) (b : Fin (n + 1)) :
    a.succ.predAbove b.succ = (a.predAbove b).succ := by
  obtain h₁ | h₂ := lt_or_le (castSucc a) b
  · rw [Fin.predAbove_above _ _ h₁, Fin.succ_pred, Fin.predAbove_above, Fin.pred_succ]
    simpa only [lt_iff_val_lt_val, coe_castSucc, val_succ, add_lt_add_iff_right] using
      h₁
  · cases' n with n
    · exfalso
      exact not_lt_zero' a.is_lt
    · rw [Fin.predAbove_below a b h₂,
        Fin.predAbove_below a.succ b.succ
          (by
            simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right]
              using h₂)]
      ext
      have h₀ : (b : ℕ) < n + 1 := by
        simp only [le_iff_val_le_val, coe_castSucc] at h₂
        simpa only [lt_succ_iff] using h₂.trans a.is_le
      have h₁ : (b.succ : ℕ) < n + 2 := by
        

Proof state:
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ castSucc a
h₀ : ↑b < n + 1
⊢ ↑(succ b) < n + 2

Next tactic:
rw [← Nat.succ_lt_succ_iff] at h₀
/-- `succ` commutes with `predAbove`. -/
@[simp]
theorem succ_predAbove_succ {n : ℕ} (a : Fin n) (b : Fin (n + 1)) :
    a.succ.predAbove b.succ = (a.predAbove b).succ := by
  obtain h₁ | h₂ := lt_or_le (castSucc a) b
  · rw [Fin.predAbove_above _ _ h₁, Fin.succ_pred, Fin.predAbove_above, Fin.pred_succ]
    simpa only [lt_iff_val_lt_val, coe_castSucc, val_succ, add_lt_add_iff_right] using
      h₁
  · cases' n with n
    · exfalso
      exact not_lt_zero' a.is_lt
    · rw [Fin.predAbove_below a b h₂,
        Fin.predAbove_below a.succ b.succ
          (by
            simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right]
              using h₂)]
      ext
      have h₀ : (b : ℕ) < n + 1 := by
        simp only [le_iff_val_le_val, coe_castSucc] at h₂
        simpa only [lt_succ_iff] using h₂.trans a.is_le
      have h₁ : (b.succ : ℕ) < n + 2 := by
        rw [← Nat.succ_lt_succ_iff] at h₀
        

Proof state:
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ castSucc a
h₀ : Nat.succ ↑b < Nat.succ (n + 1)
⊢ ↑(succ b) < n + 2

Next tactic:
simpa only [val_succ] using h₀
/-- `succ` commutes with `predAbove`. -/
@[simp]
theorem succ_predAbove_succ {n : ℕ} (a : Fin n) (b : Fin (n + 1)) :
    a.succ.predAbove b.succ = (a.predAbove b).succ := by
  obtain h₁ | h₂ := lt_or_le (castSucc a) b
  · rw [Fin.predAbove_above _ _ h₁, Fin.succ_pred, Fin.predAbove_above, Fin.pred_succ]
    simpa only [lt_iff_val_lt_val, coe_castSucc, val_succ, add_lt_add_iff_right] using
      h₁
  · cases' n with n
    · exfalso
      exact not_lt_zero' a.is_lt
    · rw [Fin.predAbove_below a b h₂,
        Fin.predAbove_below a.succ b.succ
          (by
            simpa only [le_iff_val_le_val, val_succ, coe_castSucc, add_le_add_iff_right]
              using h₂)]
      ext
      have h₀ : (b : ℕ) < n + 1 := by
        simp only [le_iff_val_le_val, coe_castSucc] at h₂
        simpa only [lt_succ_iff] using h₂.trans a.is_le
      have h₁ : (b.succ : ℕ) < n + 2 := by
        rw [← Nat.succ_lt_succ_iff] at h₀
        simpa only [val_succ] using h₀
      

Proof state:
case inr.succ.h
n✝ m n : ℕ
a : Fin (Nat.succ n)
b : Fin (Nat.succ n + 1)
h₂ : b ≤ castSucc a
h₀ : ↑b < n + 1
h₁ : ↑(succ b) < n + 2
⊢ ↑(castPred (succ b)) = ↑(succ (castPred b))

Next tactic:
simp only [coe_castPred b h₀, coe_castPred b.succ h₁, val_succ]
@[simp]
theorem castPred_castSucc (i : Fin (n + 1)) : castPred (castSucc i) = i := by
  

Proof state:
n m : ℕ
i : Fin (n + 1)
⊢ castPred (castSucc i) = i

Next tactic:
simp [castPred, predAbove, not_lt.mpr (le_last i)]
theorem castSucc_castPred {i : Fin (n + 2)} (h : i < last (n + 1)) :
    castSucc i.castPred = i := by
  

Proof state:
n m : ℕ
i : Fin (n + 2)
h : i < last (n + 1)
⊢ castSucc (castPred i) = i

Next tactic:
rw [castPred, predAbove, dif_neg]
theorem castSucc_castPred {i : Fin (n + 2)} (h : i < last (n + 1)) :
    castSucc i.castPred = i := by
  rw [castPred, predAbove, dif_neg]
  · 

Proof state:
n m : ℕ
i : Fin (n + 2)
h : i < last (n + 1)
⊢ castSucc (castLT i (_ : ↑i < n + 1)) = i

Next tactic:
simp [Fin.eq_iff_veq]
theorem castSucc_castPred {i : Fin (n + 2)} (h : i < last (n + 1)) :
    castSucc i.castPred = i := by
  rw [castPred, predAbove, dif_neg]
  · simp [Fin.eq_iff_veq]
  · 

Proof state:
case hnc
n m : ℕ
i : Fin (n + 2)
h : i < last (n + 1)
⊢ ¬castSucc (last n) < i

Next tactic:
exact h.not_le
theorem coe_castPred_le_self (i : Fin (n + 2)) : (i.castPred : ℕ) ≤ i := by
  

Proof state:
n m : ℕ
i : Fin (n + 2)
⊢ ↑(castPred i) ≤ ↑i

Next tactic:
rcases i.le_last.eq_or_lt with (rfl | h)
theorem coe_castPred_le_self (i : Fin (n + 2)) : (i.castPred : ℕ) ≤ i := by
  rcases i.le_last.eq_or_lt with (rfl | h)
  · 

Proof state:
case inl
n m : ℕ
⊢ ↑(castPred (last (n + 1))) ≤ ↑(last (n + 1))

Next tactic:
simp
theorem coe_castPred_le_self (i : Fin (n + 2)) : (i.castPred : ℕ) ≤ i := by
  rcases i.le_last.eq_or_lt with (rfl | h)
  · simp
  · 

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
h : i < last (n + 1)
⊢ ↑(castPred i) ≤ ↑i

Next tactic:
rw [castPred, predAbove, dif_neg]
theorem coe_castPred_le_self (i : Fin (n + 2)) : (i.castPred : ℕ) ≤ i := by
  rcases i.le_last.eq_or_lt with (rfl | h)
  · simp
  · rw [castPred, predAbove, dif_neg]
    · 

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
h : i < last (n + 1)
⊢ ↑(castLT i (_ : ↑i < n + 1)) ≤ ↑i

Next tactic:
simp
theorem coe_castPred_le_self (i : Fin (n + 2)) : (i.castPred : ℕ) ≤ i := by
  rcases i.le_last.eq_or_lt with (rfl | h)
  · simp
  · rw [castPred, predAbove, dif_neg]
    · simp
    · 

Proof state:
case inr.hnc
n m : ℕ
i : Fin (n + 2)
h : i < last (n + 1)
⊢ ¬castSucc (last n) < i

Next tactic:
simpa [lt_iff_val_lt_val, le_iff_val_le_val, lt_succ_iff] using h
theorem coe_castPred_lt_iff {i : Fin (n + 2)} : (i.castPred : ℕ) < i ↔ i = Fin.last _ := by
  

Proof state:
n m : ℕ
i : Fin (n + 2)
⊢ ↑(castPred i) < ↑i ↔ i = last (n + 1)

Next tactic:
rcases i.le_last.eq_or_lt with (rfl | H)
theorem coe_castPred_lt_iff {i : Fin (n + 2)} : (i.castPred : ℕ) < i ↔ i = Fin.last _ := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · 

Proof state:
case inl
n m : ℕ
⊢ ↑(castPred (last (n + 1))) < ↑(last (n + 1)) ↔ last (n + 1) = last (n + 1)

Next tactic:
simp
theorem coe_castPred_lt_iff {i : Fin (n + 2)} : (i.castPred : ℕ) < i ↔ i = Fin.last _ := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · simp
  · 

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
H : i < last (n + 1)
⊢ ↑(castPred i) < ↑i ↔ i = last (n + 1)

Next tactic:
simp only [_root_.ne_of_lt H]
theorem coe_castPred_lt_iff {i : Fin (n + 2)} : (i.castPred : ℕ) < i ↔ i = Fin.last _ := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · simp
  · simp only [_root_.ne_of_lt H]
    

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
H : i < last (n + 1)
⊢ ↑(castPred i) < ↑i ↔ False

Next tactic:
rw [← castSucc_castPred H]
theorem coe_castPred_lt_iff {i : Fin (n + 2)} : (i.castPred : ℕ) < i ↔ i = Fin.last _ := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · simp
  · simp only [_root_.ne_of_lt H]
    rw [← castSucc_castPred H]
    

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
H : i < last (n + 1)
⊢ ↑(castPred (castSucc (castPred i))) < ↑(castSucc (castPred i)) ↔ False

Next tactic:
simp
theorem lt_last_iff_coe_castPred {i : Fin (n + 2)} :
    i < Fin.last _ ↔ (i.castPred : ℕ) = i := by
  

Proof state:
n m : ℕ
i : Fin (n + 2)
⊢ i < last (n + 1) ↔ ↑(castPred i) = ↑i

Next tactic:
rcases i.le_last.eq_or_lt with (rfl | H)
theorem lt_last_iff_coe_castPred {i : Fin (n + 2)} :
    i < Fin.last _ ↔ (i.castPred : ℕ) = i := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · 

Proof state:
case inl
n m : ℕ
⊢ last (n + 1) < last (n + 1) ↔ ↑(castPred (last (n + 1))) = ↑(last (n + 1))

Next tactic:
simp
theorem lt_last_iff_coe_castPred {i : Fin (n + 2)} :
    i < Fin.last _ ↔ (i.castPred : ℕ) = i := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · simp
  · 

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
H : i < last (n + 1)
⊢ i < last (n + 1) ↔ ↑(castPred i) = ↑i

Next tactic:
simp only [H]
theorem lt_last_iff_coe_castPred {i : Fin (n + 2)} :
    i < Fin.last _ ↔ (i.castPred : ℕ) = i := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · simp
  · simp only [H]
    

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
H : i < last (n + 1)
⊢ True ↔ ↑(castPred i) = ↑i

Next tactic:
rw [← castSucc_castPred H]
theorem lt_last_iff_coe_castPred {i : Fin (n + 2)} :
    i < Fin.last _ ↔ (i.castPred : ℕ) = i := by
  rcases i.le_last.eq_or_lt with (rfl | H)
  · simp
  · simp only [H]
    rw [← castSucc_castPred H]
    

Proof state:
case inr
n m : ℕ
i : Fin (n + 2)
H : i < last (n + 1)
⊢ True ↔ ↑(castPred (castSucc (castPred i))) = ↑(castSucc (castPred i))

Next tactic:
simp
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  

Proof state:
n✝ m n : ℕ
i : Fin (n + 1)
⊢ (∃ j, i = castSucc j) ∨ i = last n

Next tactic:
induction i using reverseInduction with
  | last => right; rfl
  | cast n => left; exact ⟨_, rfl⟩
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  induction i using reverseInduction with
  

Proof state:
case last
n✝ m n : ℕ
⊢ (∃ j, last n = castSucc j) ∨ last n = last n

Next tactic:
| last => right; rfl
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  induction i using reverseInduction with
  | last => 

Proof state:
case last
n✝ m n : ℕ
⊢ (∃ j, last n = castSucc j) ∨ last n = last n

Next tactic:
right
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  induction i using reverseInduction with
  | last => right; 

Proof state:
case last.h
n✝ m n : ℕ
⊢ last n = last n

Next tactic:
rfl
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  induction i using reverseInduction with
  | last => right; rfl
  

Proof state:
case cast
n✝¹ m n✝ : ℕ
n : Fin n✝
a✝ : (∃ j, succ n = castSucc j) ∨ succ n = last n✝
⊢ (∃ j, castSucc n = castSucc j) ∨ castSucc n = last n✝

Next tactic:
| cast n => left; exact ⟨_, rfl⟩
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  induction i using reverseInduction with
  | last => right; rfl
  | cast n => 

Proof state:
case cast
n✝¹ m n✝ : ℕ
n : Fin n✝
a✝ : (∃ j, succ n = castSucc j) ∨ succ n = last n✝
⊢ (∃ j, castSucc n = castSucc j) ∨ castSucc n = last n✝

Next tactic:
left
theorem eq_castSucc_or_eq_last {n : Nat} (i : Fin (n + 1)) :
    (∃ j : Fin n, i = j.castSucc) ∨ i = last n := by
  induction i using reverseInduction with
  | last => right; rfl
  | cast n => left; 

Proof state:
case cast.h
n✝¹ m n✝ : ℕ
n : Fin n✝
a✝ : (∃ j, succ n = castSucc j) ∨ succ n = last n✝
⊢ ∃ j, castSucc n = castSucc j

Next tactic:
exact ⟨_, rfl⟩
protected theorem mul_one' [NeZero n] (k : Fin n) : k * 1 = k := by
  

Proof state:
n m : ℕ
inst✝ : NeZero n
k : Fin n
⊢ k * 1 = k

Next tactic:
cases' n with n
protected theorem mul_one' [NeZero n] (k : Fin n) : k * 1 = k := by
  cases' n with n
  · 

Proof state:
case zero
m : ℕ
inst✝ : NeZero zero
k : Fin zero
⊢ k * 1 = k

Next tactic:
simp [eq_iff_true_of_subsingleton]
protected theorem mul_one' [NeZero n] (k : Fin n) : k * 1 = k := by
  cases' n with n
  · simp [eq_iff_true_of_subsingleton]
  

Proof state:
case succ
m n : ℕ
inst✝ : NeZero (Nat.succ n)
k : Fin (Nat.succ n)
⊢ k * 1 = k

Next tactic:
cases n
protected theorem mul_one' [NeZero n] (k : Fin n) : k * 1 = k := by
  cases' n with n
  · simp [eq_iff_true_of_subsingleton]
  cases n
  · 

Proof state:
case succ.zero
m : ℕ
inst✝ : NeZero (Nat.succ zero)
k : Fin (Nat.succ zero)
⊢ k * 1 = k

Next tactic:
simp [fin_one_eq_zero]
protected theorem mul_one' [NeZero n] (k : Fin n) : k * 1 = k := by
  cases' n with n
  · simp [eq_iff_true_of_subsingleton]
  cases n
  · simp [fin_one_eq_zero]
  

Proof state:
case succ.succ
m n✝ : ℕ
inst✝ : NeZero (Nat.succ (Nat.succ n✝))
k : Fin (Nat.succ (Nat.succ n✝))
⊢ k * 1 = k

Next tactic:
simp [eq_iff_veq, mul_def, mod_eq_of_lt (is_lt k)]
protected theorem one_mul' [NeZero n] (k : Fin n) : (1 : Fin n) * k = k := by
  

Proof state:
n m : ℕ
inst✝ : NeZero n
k : Fin n
⊢ 1 * k = k

Next tactic:
rw [Fin.mul_comm, Fin.mul_one']
protected theorem mul_zero' [NeZero n] (k : Fin n) : k * 0 = 0 := by 

Proof state:
n m : ℕ
inst✝ : NeZero n
k : Fin n
⊢ k * 0 = 0

Next tactic:
simp [eq_iff_veq, mul_def]
protected theorem zero_mul' [NeZero n] (k : Fin n) : (0 : Fin n) * k = 0 := by
  

Proof state:
n m : ℕ
inst✝ : NeZero n
k : Fin n
⊢ 0 * k = 0

Next tactic:
simp [eq_iff_veq, mul_def]
open Qq in
instance toExpr (n : ℕ) : Lean.ToExpr (Fin n) where
  toTypeExpr := q(Fin $n)
  toExpr := match n with
    | 0 => finZeroElim
    | k + 1 => fun i => show Q(Fin $n) from
      have i : Q(Nat) := Lean.mkRawNatLit i -- raw literal to avoid ofNat-double-wrapping
      have : Q(NeZero $n) := haveI : $n =Q $k + 1 := ⟨⟩; by 

Proof state:
n✝ m n k : ℕ
i✝ : Fin (k + 1)
i : Q(ℕ)
this : «$n» =Q «$k» + 1
⊢ Q(NeZero «$n»)

Next tactic:
exact q(NeZero.succ)
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  

Proof state:
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
⊢ spectrum ℂ (star a * a) ⊆ Set.Icc 0 ↑‖star a * a‖

Next tactic:
rcases subsingleton_or_nontrivial A with ⟨⟩
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · 

Proof state:
case inl
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Subsingleton A
⊢ spectrum ℂ (star a * a) ⊆ Set.Icc 0 ↑‖star a * a‖

Next tactic:
simp only [spectrum.of_subsingleton, Set.empty_subset]
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · 

Proof state:
case inr
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
⊢ spectrum ℂ (star a * a) ⊆ Set.Icc 0 ↑‖star a * a‖

Next tactic:
set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
    

Proof state:
case inr
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
⊢ spectrum ℂ (star a * a) ⊆ Set.Icc 0 ↑‖star a * a‖

Next tactic:
refine' (spectrum.subset_starSubalgebra (star a' * a')).trans _
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
    refine' (spectrum.subset_starSubalgebra (star a' * a')).trans _
    

Proof state:
case inr
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
⊢ spectrum ℂ (star a' * a') ⊆ Set.Icc 0 ↑‖star a * a‖

Next tactic:
rw [← spectrum.gelfandTransform_eq (star a' * a'), ContinuousMap.spectrum_eq_range]
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
    refine' (spectrum.subset_starSubalgebra (star a' * a')).trans _
    rw [← spectrum.gelfandTransform_eq (star a' * a'), ContinuousMap.spectrum_eq_range]
    

Proof state:
case inr
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
⊢ Set.range ⇑((gelfandTransform ℂ ↥(elementalStarAlgebra ℂ a)) (star a' * a')) ⊆ Set.Icc 0 ↑‖star a * a‖

Next tactic:
rintro - ⟨φ, rfl⟩