/-
Copyright (c) 2024 Jireh Loreaux. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jireh Loreaux
-/
module
public import Mathlib.Algebra.Order.Star.Real
public import Mathlib.Analysis.Complex.Basic
public import Mathlib.Topology.ContinuousMap.StarOrdered
/-! # Instances of `ContinuousSqrt`
This provides the instances of `ContinuousSqrt` for `ℝ`, `ℝ≥0`, and `ℂ`, thereby yielding instances
of `StarOrderedRing C(α, R)` and `StarOrderedRing C(α, R)₀` for any topological space `α` and `R`
among `ℝ≥0`, `ℝ`, and `ℂ`. -/
public section
open scoped NNReal
open scoped ComplexOrder in
open RCLike in
noncomputable
instance (priority := 100) instContinuousSqrtRCLike { : Type*} [RCLike ] :
ContinuousSqrt where
sqrt := ((↑) ∘ (√·) ∘ re ∘ (fun z ↦ z.2 - z.1))
continuousOn_sqrt := by fun_prop
sqrt_nonneg _ _ := by simp
sqrt_mul_sqrt x hx := by
simp only [Function.comp_apply]
rw [← sub_nonneg] at hx
obtain hx' := nonneg_iff.mp hx |>.right
rw [← conj_eq_iff_im, conj_eq_iff_re] at hx'
rw [← ofReal_mul, Real.mul_self_sqrt, hx', add_sub_cancel]
simpa using nonneg_iff.mp hx |>.left
noncomputable instance : ContinuousSqrt ℝ := instContinuousSqrtRCLike ( := ℝ)
open ComplexOrder in
noncomputable instance : ContinuousSqrt ℂ := instContinuousSqrtRCLike ( := ℂ)
noncomputable instance : ContinuousSqrt ℝ≥0 where
sqrt := NNReal.sqrt ∘ (fun x ↦ x.2 - x.1)
continuousOn_sqrt := by fun_prop
sqrt_nonneg := by simp
sqrt_mul_sqrt := by simpa using fun _ _ h ↦ Eq.symm <| add_tsub_cancel_of_le h
¤ Dauer der Verarbeitung: 0.3 Sekunden
¤
*© Formatika GbR, Deutschland