Theorem: StarAlgHom.realContinuousMapOfNNReal_apply
File: Mathlib/Analysis/CstarAlgebra/ContinuousFunctionalCalculus/Unique.lean

Proof steps:
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
⊢ (fun f => φ f.toNNReal - φ (-f).toNNReal) 1 = 1
state_after: no goals
tactic: simp
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
⊢ (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun 0 = 0
state_after: no goals
tactic: simp
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
⊢ { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun (f * g) =
    { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun f *
      { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun g
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ ((f * g).toNNReal + (-f).toNNReal * g.toNNReal + f.toNNReal * (-g).toNNReal) =
    φ ((-(f * g)).toNNReal + f.toNNReal * g.toNNReal + (-f).toNNReal * (-g).toNNReal)
⊢ { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun (f * g) =
    { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun f *
      { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun g
tactic: have := congr(φ $(f.toNNReal_mul_add_neg_mul_add_mul_neg_eq g))
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ ((f * g).toNNReal + (-f).toNNReal * g.toNNReal + f.toNNReal * (-g).toNNReal) =
    φ ((-(f * g)).toNNReal + f.toNNReal * g.toNNReal + (-f).toNNReal * (-g).toNNReal)
⊢ { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun (f * g) =
    { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun f *
      { toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯ }.toFun g
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal =
    φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal
⊢ φ (f * g).toNNReal - φ (-(f * g)).toNNReal =
    φ f.toNNReal * φ g.toNNReal - φ (-f).toNNReal * φ g.toNNReal -
      (φ f.toNNReal * φ (-g).toNNReal - φ (-f).toNNReal * φ (-g).toNNReal)
tactic: simp only [map_add, map_mul, sub_mul, mul_sub] at this ⊢
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal =
    φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal
⊢ φ (f * g).toNNReal - φ (-(f * g)).toNNReal =
    φ f.toNNReal * φ g.toNNReal - φ (-f).toNNReal * φ g.toNNReal -
      (φ f.toNNReal * φ (-g).toNNReal - φ (-f).toNNReal * φ (-g).toNNReal)
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal -
      (φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal) =
    0
⊢ φ (f * g).toNNReal - φ (-(f * g)).toNNReal -
      (φ f.toNNReal * φ g.toNNReal - φ (-f).toNNReal * φ g.toNNReal -
        (φ f.toNNReal * φ (-g).toNNReal - φ (-f).toNNReal * φ (-g).toNNReal)) =
    0
tactic: rw [← sub_eq_zero] at this ⊢
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal -
      (φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal) =
    0
⊢ φ (f * g).toNNReal - φ (-(f * g)).toNNReal -
      (φ f.toNNReal * φ g.toNNReal - φ (-f).toNNReal * φ g.toNNReal -
        (φ f.toNNReal * φ (-g).toNNReal - φ (-f).toNNReal * φ (-g).toNNReal)) =
    0
state_after: case h.e'_2
X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal -
      (φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal) =
    0
⊢ φ (f * g).toNNReal - φ (-(f * g)).toNNReal -
      (φ f.toNNReal * φ g.toNNReal - φ (-f).toNNReal * φ g.toNNReal -
        (φ f.toNNReal * φ (-g).toNNReal - φ (-f).toNNReal * φ (-g).toNNReal)) =
    φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal -
      (φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal)
tactic: convert this using 1
state_before: case h.e'_2
X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal -
      (φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal) =
    0
⊢ φ (f * g).toNNReal - φ (-(f * g)).toNNReal -
      (φ f.toNNReal * φ g.toNNReal - φ (-f).toNNReal * φ g.toNNReal -
        (φ f.toNNReal * φ (-g).toNNReal - φ (-f).toNNReal * φ (-g).toNNReal)) =
    φ (f * g).toNNReal + φ (-f).toNNReal * φ g.toNNReal + φ f.toNNReal * φ (-g).toNNReal -
      (φ (-(f * g)).toNNReal + φ f.toNNReal * φ g.toNNReal + φ (-f).toNNReal * φ (-g).toNNReal)
state_after: no goals
tactic: abel
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
⊢ (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun (f + g) =
    (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun f +
      (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun g
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this : φ ((f + g).toNNReal + (-f).toNNReal + (-g).toNNReal) = φ ((-(f + g)).toNNReal + f.toNNReal + g.toNNReal)
⊢ (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun (f + g) =
    (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun f +
      (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun g
tactic: have := congr(φ $(f.toNNReal_add_add_neg_add_neg_eq g))
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this : φ ((f + g).toNNReal + (-f).toNNReal + (-g).toNNReal) = φ ((-(f + g)).toNNReal + f.toNNReal + g.toNNReal)
⊢ (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun (f + g) =
    (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun f +
      (↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯ }).toFun g
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this : φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal = φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal
⊢ φ (f + g).toNNReal - φ (-(f + g)).toNNReal = φ f.toNNReal - φ (-f).toNNReal + (φ g.toNNReal - φ (-g).toNNReal)
tactic: simp only [map_add] at this ⊢
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this : φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal = φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal
⊢ φ (f + g).toNNReal - φ (-(f + g)).toNNReal = φ f.toNNReal - φ (-f).toNNReal + (φ g.toNNReal - φ (-g).toNNReal)
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal - (φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal) = 0
⊢ φ (f + g).toNNReal - φ (-(f + g)).toNNReal - (φ f.toNNReal - φ (-f).toNNReal + (φ g.toNNReal - φ (-g).toNNReal)) = 0
tactic: rw [← sub_eq_zero] at this ⊢
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal - (φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal) = 0
⊢ φ (f + g).toNNReal - φ (-(f + g)).toNNReal - (φ f.toNNReal - φ (-f).toNNReal + (φ g.toNNReal - φ (-g).toNNReal)) = 0
state_after: case h.e'_2
X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal - (φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal) = 0
⊢ φ (f + g).toNNReal - φ (-(f + g)).toNNReal - (φ f.toNNReal - φ (-f).toNNReal + (φ g.toNNReal - φ (-g).toNNReal)) =
    φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal - (φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal)
tactic: convert this using 1
state_before: case h.e'_2
X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f g : C(X, ℝ)
this :
  φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal - (φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal) = 0
⊢ φ (f + g).toNNReal - φ (-(f + g)).toNNReal - (φ f.toNNReal - φ (-f).toNNReal + (φ g.toNNReal - φ (-g).toNNReal)) =
    φ (f + g).toNNReal + φ (-f).toNNReal + φ (-g).toNNReal - (φ (-(f + g)).toNNReal + φ f.toNNReal + φ g.toNNReal)
state_after: no goals
tactic: abel
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
r : ℝ
⊢ (↑↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯,
              map_add' := ⋯ }).toFun
      ((algebraMap ℝ C(X, ℝ)) r) =
    (algebraMap ℝ A) r
state_after: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
r : ℝ
⊢ φ ((algebraMap ℝ C(X, ℝ)) r).toNNReal - φ (-(algebraMap ℝ C(X, ℝ)) r).toNNReal = (algebraMap ℝ A) r
tactic: simp only
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
r : ℝ
⊢ φ ((algebraMap ℝ C(X, ℝ)) r).toNNReal - φ (-(algebraMap ℝ C(X, ℝ)) r).toNNReal = (algebraMap ℝ A) r
state_after: case inl
X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
r : ℝ
hr : 0 ≤ r
⊢ φ ((algebraMap ℝ C(X, ℝ)) r).toNNReal - φ (-(algebraMap ℝ C(X, ℝ)) r).toNNReal = (algebraMap ℝ A) r

case inr
X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
r : ℝ
hr : r ≤ 0
⊢ φ ((algebraMap ℝ C(X, ℝ)) r).toNNReal - φ (-(algebraMap ℝ C(X, ℝ)) r).toNNReal = (algebraMap ℝ A) r
tactic: obtain (hr | hr) := le_total 0 r
state_before: X : Type u_1
inst✝⁵ : TopologicalSpace X
A : Type u_2
inst✝⁴ : TopologicalSpace A
inst✝³ : Ring A
inst✝² : StarRing A
inst✝¹ : Algebra ℝ A
inst✝ : TopologicalRing A
φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A
f : C(X, ℝ)
⊢ (↑↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯,
                commutes' := ⋯ }.toRingHom).toFun
      (star f) =
    star
      ((↑↑{ toFun := fun f => φ f.toNNReal - φ (-f).toNNReal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯,
                  map_add' := ⋯, commutes' := ⋯ }.toRingHom).toFun
        f)
state_after: no goals
tactic: simp only [star_trivial, star_sub, ← map_star]