Theorem: ContinuousMap.starOrderedRing_of_sqrt
File: Mathlib/Topology/ContinuousFunction/StarOrdered.lean

tactic: constructor
state_before: α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ 0 ≤ f ↔ ∃ s, f = star s * s
state_after: case mp
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ 0 ≤ f → ∃ s, f = star s * s

case mpr
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ (∃ s, f = star s * s) → 0 ≤ f

tactic: intro hf
state_before: case mp
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ 0 ≤ f → ∃ s, f = star s * s
state_after: case mp
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
hf : 0 ≤ f
⊢ ∃ s, f = star s * s

tactic: ext x
state_before: case h
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
hf : 0 ≤ f
⊢ f =
    star
        ({ toFun := {x | 0 ≤ x}.restrict sqrt, continuous_toFun := ⋯ }.comp
          { toFun := Set.codRestrict ⇑f {x | 0 ≤ x} ⋯, continuous_toFun := ⋯ }) *
      { toFun := {x | 0 ≤ x}.restrict sqrt, continuous_toFun := ⋯ }.comp
        { toFun := Set.codRestrict ⇑f {x | 0 ≤ x} ⋯, continuous_toFun := ⋯ }
state_after: case h.h
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
hf : 0 ≤ f
x : α
⊢ f x =
    (star
          ({ toFun := {x | 0 ≤ x}.restrict sqrt, continuous_toFun := ⋯ }.comp
            { toFun := Set.codRestrict ⇑f {x | 0 ≤ x} ⋯, continuous_toFun := ⋯ }) *
        { toFun := {x | 0 ≤ x}.restrict sqrt, continuous_toFun := ⋯ }.comp
          { toFun := Set.codRestrict ⇑f {x | 0 ≤ x} ⋯, continuous_toFun := ⋯ })
      x

tactic: exact h_sqrt (f x) (hf x) |>.symm
state_before: case h.h
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
hf : 0 ≤ f
x : α
⊢ f x =
    (star
          ({ toFun := {x | 0 ≤ x}.restrict sqrt, continuous_toFun := ⋯ }.comp
            { toFun := Set.codRestrict ⇑f {x | 0 ≤ x} ⋯, continuous_toFun := ⋯ }) *
        { toFun := {x | 0 ≤ x}.restrict sqrt, continuous_toFun := ⋯ }.comp
          { toFun := Set.codRestrict ⇑f {x | 0 ≤ x} ⋯, continuous_toFun := ⋯ })
      x
state_after: no goals

tactic: rintro ⟨f, rfl⟩
state_before: case mpr
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ (∃ s, f = star s * s) → 0 ≤ f
state_after: case mpr.intro
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ 0 ≤ star f * f

tactic: rw [ContinuousMap.le_def]
state_before: case mpr.intro
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ 0 ≤ star f * f
state_after: case mpr.intro
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ ∀ (a : α), 0 a ≤ (star f * f) a

tactic: exact fun x ↦ star_mul_self_nonneg (f x)
state_before: case mpr.intro
α : Type u_1
inst✝⁷ : TopologicalSpace α
R : Type u_2
inst✝⁶ : PartialOrder R
inst✝⁵ : NonUnitalRing R
inst✝⁴ : StarRing R
inst✝³ : StarOrderedRing R
inst✝² : TopologicalSpace R
inst✝¹ : ContinuousStar R
inst✝ : TopologicalRing R
sqrt : R → R
h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x}
h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x
f : C(α, R)
⊢ ∀ (a : α), 0 a ≤ (star f * f) a
state_after: no goals