Theorem: CstarRing.spectralOrderedRing
File: Mathlib/Analysis/NormedSpace/Star/ContinuousFunctionalCalculus/Instances.lean

tactic: intro x y
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
⊢ ∀ (x y : A), x ≤ y ↔ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p
state_after: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
⊢ x ≤ y ↔ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p

tactic: constructor
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
⊢ x ≤ y ↔ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p
state_after: case mp
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
⊢ x ≤ y → ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p

case mpr
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
⊢ (∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p) → x ≤ y

tactic: intro h
state_before: case mp
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
⊢ x ≤ y → ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p
state_after: case mp
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
⊢ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p

tactic: obtain ⟨s, hs₁, _, hs₂⟩ := CFC.exists_sqrt_of_isSelfAdjoint_of_spectrumRestricts h.1 h.2
state_before: case mp
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
⊢ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p
state_after: case mp.intro.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
s : A
hs₁ : IsSelfAdjoint s
left✝ : SpectrumRestricts s ⇑ContinuousMap.realToNNReal
hs₂ : s ^ 2 = y - x
⊢ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p

tactic: refine ⟨s ^ 2, ?_, by rwa [eq_sub_iff_add_eq', eq_comm] at hs₂⟩
state_before: case mp.intro.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
s : A
hs₁ : IsSelfAdjoint s
left✝ : SpectrumRestricts s ⇑ContinuousMap.realToNNReal
hs₂ : s ^ 2 = y - x
⊢ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p
state_after: case mp.intro.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
s : A
hs₁ : IsSelfAdjoint s
left✝ : SpectrumRestricts s ⇑ContinuousMap.realToNNReal
hs₂ : s ^ 2 = y - x
⊢ s ^ 2 ∈ AddSubmonoid.closure (Set.range fun s => star s * s)

tactic: exact AddSubmonoid.subset_closure ⟨s, by simp [hs₁.star_eq, sq]⟩
state_before: case mp.intro.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
s : A
hs₁ : IsSelfAdjoint s
left✝ : SpectrumRestricts s ⇑ContinuousMap.realToNNReal
hs₂ : s ^ 2 = y - x
⊢ s ^ 2 ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
state_after: no goals

tactic: rwa [eq_sub_iff_add_eq', eq_comm] at hs₂
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
s : A
hs₁ : IsSelfAdjoint s
left✝ : SpectrumRestricts s ⇑ContinuousMap.realToNNReal
hs₂ : s ^ 2 = y - x
⊢ y = x + s ^ 2
state_after: no goals

tactic: simp [hs₁.star_eq, sq]
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
h : x ≤ y
s : A
hs₁ : IsSelfAdjoint s
left✝ : SpectrumRestricts s ⇑ContinuousMap.realToNNReal
hs₂ : s ^ 2 = y - x
⊢ (fun s => star s * s) s = s ^ 2
state_after: no goals

tactic: rintro ⟨p, hp, rfl⟩
state_before: case mpr
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x y : A
⊢ (∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p) → x ≤ y
state_after: case mpr.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
hp : p ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
⊢ x ≤ x + p

tactic: suffices IsSelfAdjoint p ∧ SpectrumRestricts p ContinuousMap.realToNNReal from
  ⟨by simpa using this.1, by simpa using this.2⟩
state_before: case mpr.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
hp : p ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
⊢ x ≤ x + p
state_after: case mpr.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
hp : p ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
⊢ IsSelfAdjoint p ∧ SpectrumRestricts p ⇑ContinuousMap.realToNNReal

tactic: induction hp using AddSubmonoid.closure_induction' with
| mem x hx =>
  obtain ⟨s, rfl⟩ := hx
  refine ⟨IsSelfAdjoint.star_mul_self s, ?_⟩
  rw [SpectrumRestricts.nnreal_iff]
  exact spectrum_star_mul_self_nonneg
| one =>
  rw [SpectrumRestricts.nnreal_iff]
  nontriviality A
  simp
| mul x _ y _ hx hy =>
  exact ⟨hx.1.add hy.1, hx.2.nnreal_add hx.1 hy.1 hy.2⟩
state_before: case mpr.intro.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
hp : p ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
⊢ IsSelfAdjoint p ∧ SpectrumRestricts p ⇑ContinuousMap.realToNNReal
state_after: no goals

tactic: simpa using this.1
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
hp : p ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
this : IsSelfAdjoint p ∧ SpectrumRestricts p ⇑ContinuousMap.realToNNReal
⊢ IsSelfAdjoint (x + p - x)
state_after: no goals

tactic: simpa using this.2
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
hp : p ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
this : IsSelfAdjoint p ∧ SpectrumRestricts p ⇑ContinuousMap.realToNNReal
⊢ SpectrumRestricts (x + p - x) ⇑ContinuousMap.realToNNReal
state_after: no goals

tactic: obtain ⟨s, rfl⟩ := hx
state_before: case mpr.intro.intro.mem
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝¹ : PartialOrder A := spectralOrder A
x✝ p x : A
hx : x ∈ Set.range fun s => star s * s
⊢ IsSelfAdjoint x ∧ SpectrumRestricts x ⇑ContinuousMap.realToNNReal
state_after: case mpr.intro.intro.mem.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p s : A
⊢ IsSelfAdjoint ((fun s => star s * s) s) ∧ SpectrumRestricts ((fun s => star s * s) s) ⇑ContinuousMap.realToNNReal

tactic: refine ⟨IsSelfAdjoint.star_mul_self s, ?_⟩
state_before: case mpr.intro.intro.mem.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p s : A
⊢ IsSelfAdjoint ((fun s => star s * s) s) ∧ SpectrumRestricts ((fun s => star s * s) s) ⇑ContinuousMap.realToNNReal
state_after: case mpr.intro.intro.mem.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p s : A
⊢ SpectrumRestricts ((fun s => star s * s) s) ⇑ContinuousMap.realToNNReal

tactic: rw [SpectrumRestricts.nnreal_iff]
state_before: case mpr.intro.intro.mem.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p s : A
⊢ SpectrumRestricts ((fun s => star s * s) s) ⇑ContinuousMap.realToNNReal
state_after: case mpr.intro.intro.mem.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p s : A
⊢ ∀ x ∈ σ ℝ ((fun s => star s * s) s), 0 ≤ x

tactic: exact spectrum_star_mul_self_nonneg
state_before: case mpr.intro.intro.mem.intro
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p s : A
⊢ ∀ x ∈ σ ℝ ((fun s => star s * s) s), 0 ≤ x
state_after: no goals

tactic: rw [SpectrumRestricts.nnreal_iff]
state_before: case mpr.intro.intro.one
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
⊢ IsSelfAdjoint 0 ∧ SpectrumRestricts 0 ⇑ContinuousMap.realToNNReal
state_after: case mpr.intro.intro.one
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
⊢ IsSelfAdjoint 0 ∧ ∀ x ∈ σ ℝ 0, 0 ≤ x

tactic: nontriviality A
state_before: case mpr.intro.intro.one
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
⊢ IsSelfAdjoint 0 ∧ ∀ x ∈ σ ℝ 0, 0 ≤ x
state_after: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
a✝ : Nontrivial A
⊢ IsSelfAdjoint 0 ∧ ∀ x ∈ σ ℝ 0, 0 ≤ x

tactic: simp
state_before: A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝ : PartialOrder A := spectralOrder A
x p : A
a✝ : Nontrivial A
⊢ IsSelfAdjoint 0 ∧ ∀ x ∈ σ ℝ 0, 0 ≤ x
state_after: no goals

tactic: exact ⟨hx.1.add hy.1, hx.2.nnreal_add hx.1 hy.1 hy.2⟩
state_before: case mpr.intro.intro.mul
A : Type u_1
inst✝⁵ : NormedRing A
inst✝⁴ : CompleteSpace A
inst✝³ : StarRing A
inst✝² : CstarRing A
inst✝¹ : NormedAlgebra ℂ A
inst✝ : StarModule ℂ A
x✝¹ : PartialOrder A := spectralOrder A
x✝ p x : A
hx✝ : x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
y : A
hy✝ : y ∈ AddSubmonoid.closure (Set.range fun s => star s * s)
hx : IsSelfAdjoint x ∧ SpectrumRestricts x ⇑ContinuousMap.realToNNReal
hy : IsSelfAdjoint y ∧ SpectrumRestricts y ⇑ContinuousMap.realToNNReal
⊢ IsSelfAdjoint (x + y) ∧ SpectrumRestricts (x + y) ⇑ContinuousMap.realToNNReal
state_after: no goals