Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: positive contractions in a C⋆-algebra form a directed set #18016

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ import Mathlib.Analysis.BoxIntegral.Partition.Measure
import Mathlib.Analysis.BoxIntegral.Partition.Split
import Mathlib.Analysis.BoxIntegral.Partition.SubboxInduction
import Mathlib.Analysis.BoxIntegral.Partition.Tagged
import Mathlib.Analysis.CStarAlgebra.ApproximateUnit
import Mathlib.Analysis.CStarAlgebra.Basic
import Mathlib.Analysis.CStarAlgebra.Classes
import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Basic
Expand Down
8 changes: 8 additions & 0 deletions Mathlib/Algebra/Algebra/Quasispectrum.lean
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,14 @@ lemma quasispectrum_eq_spectrum_inr' (R S : Type*) {A : Type*} [Semifield R]
apply forall_congr' fun x ↦ ?_
rw [not_iff_not, Units.smul_def, Units.smul_def, ← inr_smul, ← inr_neg, isQuasiregular_inr_iff]

lemma quasispectrum_inr_eq (R S : Type*) {A : Type*} [Semifield R]
[Field S] [NonUnitalRing A] [Algebra R S] [Module S A] [IsScalarTower S A A]
[SMulCommClass S A A] [Module R A] [IsScalarTower R S A] (a : A) :
quasispectrum R (a : Unitization S A) = quasispectrum R a := by
rw [quasispectrum_eq_spectrum_union_zero, quasispectrum_eq_spectrum_inr' R S]
apply Set.union_eq_self_of_subset_right
simpa using zero_mem_spectrum_inr _ _ _

end Unitization

/-- A class for `𝕜`-algebras with a partial order where the ordering is compatible with the
Expand Down
112 changes: 112 additions & 0 deletions Mathlib/Analysis/CStarAlgebra/ApproximateUnit.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/-
Copyright (c) 2024 Jireh Loreaux. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jireh Loreaux
-/
import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order
import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric
import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow

/-! # Positive contractions in a C⋆-algebra form an approximate unit

This file will show (although it does not yet) that the collection of positive contractions (of norm
strictly less than one) in a possibly non-unital C⋆-algebra form an approximate unit. The key step
is to show that this set is directed using the continuous functional calculus applied with the
functions `fun x : ℝ≥0, 1 - (1 + x)⁻¹` and `fun x : ℝ≥0, x * (1 - x)⁻¹`, which are inverses on
the interval `{x : ℝ≥0 | x < 1}`.

## Main declarations

+ `CFC.monotoneOn_one_sub_one_add_inv`: the function `f := fun x : ℝ≥0, 1 - (1 + x)⁻¹` is
*operator monotone* on `Set.Ici (0 : A)` (i.e., `cfcₙ f` is monotone on `{x : A | 0 ≤ x}`).
+ `Set.InvOn.one_sub_one_add_inv`: the functions `f := fun x : ℝ≥0, 1 - (1 + x)⁻¹` and
`g := fun x : ℝ≥0, x * (1 - x)⁻¹` are inverses on `{x : ℝ≥0 | x < 1}`.
+ `CStarAlgebra.directedOn_nonneg_ball`: the set `{x : A | 0 ≤ x} ∩ Metric.ball 0 1` is directed.

## TODO

+ Prove the approximate identity result by following Ken Davidson's proof in
"C*-Algebras by Example"

-/

variable {A : Type*} [NonUnitalCStarAlgebra A]

local notation "σₙ" => quasispectrum
local notation "σ" => spectrum

open Unitization NNReal CStarAlgebra

variable [PartialOrder A] [StarOrderedRing A]

lemma CFC.monotoneOn_one_sub_one_add_inv :
MonotoneOn (cfcₙ (fun x : ℝ≥0 ↦ 1 - (1 + x)⁻¹)) (Set.Ici (0 : A)) := by
intro a ha b hb hab
simp only [Set.mem_Ici] at ha hb
rw [← inr_le_iff .., nnreal_cfcₙ_eq_cfc_inr a _, nnreal_cfcₙ_eq_cfc_inr b _]
have h_cfc_one_sub (c : A⁺¹) (hc : 0 ≤ c := by cfc_tac) :
cfc (fun x : ℝ≥0 ↦ 1 - (1 + x)⁻¹) c = 1 - cfc (·⁻¹ : ℝ≥0 → ℝ≥0) (1 + c) := by
rw [cfc_tsub _ _ _ (fun x _ ↦ by simp) (hg := by fun_prop (disch := intro _ _; positivity)),
cfc_const_one ℝ≥0 c]
rw [cfc_comp' (·⁻¹) (1 + ·) c ?_, cfc_add .., cfc_const_one ℝ≥0 c, cfc_id' ℝ≥0 c]
refine continuousOn_id.inv₀ ?_
rintro - ⟨x, -, rfl⟩
simp only [id_def]
positivity
rw [← inr_le_iff a b (.of_nonneg ha) (.of_nonneg hb)] at hab
rw [← inr_nonneg_iff] at ha hb
rw [h_cfc_one_sub (a : A⁺¹), h_cfc_one_sub (b : A⁺¹)]
gcongr
rw [← CFC.rpow_neg_one_eq_cfc_inv, ← CFC.rpow_neg_one_eq_cfc_inv]
exact rpow_neg_one_le_rpow_neg_one (add_nonneg zero_le_one ha) (by gcongr) <|
isUnit_of_le isUnit_one zero_le_one <| le_add_of_nonneg_right ha

lemma Set.InvOn.one_sub_one_add_inv : Set.InvOn (fun x ↦ 1 - (1 + x)⁻¹) (fun x ↦ x * (1 - x)⁻¹)
{x : ℝ≥0 | x < 1} {x : ℝ≥0 | x < 1} := by
have h1_add {x : ℝ≥0} : 0 < 1 + (x : ℝ) := by positivity
have : (fun x : ℝ≥0 ↦ x * (1 + x)⁻¹) = fun x ↦ 1 - (1 + x)⁻¹ := by
ext x
field_simp
simp [sub_mul, inv_mul_cancel₀ h1_add.ne']
rw [← this]
constructor
all_goals intro x (hx : x < 1)
· have : 0 < 1 - x := tsub_pos_of_lt hx
field_simp [tsub_add_cancel_of_le hx.le, tsub_tsub_cancel_of_le hx.le]
· field_simp [mul_tsub]

lemma norm_cfcₙ_one_sub_one_add_inv_lt_one (a : A) :
‖cfcₙ (fun x : ℝ≥0 ↦ 1 - (1 + x)⁻¹) a‖ < 1 :=
nnnorm_cfcₙ_nnreal_lt fun x _ ↦ tsub_lt_self zero_lt_one (by positivity)

-- the calls to `fun_prop` with a discharger set off the linter
set_option linter.style.multiGoal false in
lemma CStarAlgebra.directedOn_nonneg_ball :
DirectedOn (· ≤ ·) ({x : A | 0 ≤ x} ∩ Metric.ball 0 1) := by
let f : ℝ≥0 → ℝ≥0 := fun x => 1 - (1 + x)⁻¹
let g : ℝ≥0 → ℝ≥0 := fun x => x * (1 - x)⁻¹
suffices ∀ a b : A, 0 ≤ a → 0 ≤ b → ‖a‖ < 1 → ‖b‖ < 1 →
a ≤ cfcₙ f (cfcₙ g a + cfcₙ g b) by
rintro a ⟨(ha₁ : 0 ≤ a), ha₂⟩ b ⟨(hb₁ : 0 ≤ b), hb₂⟩
simp only [Metric.mem_ball, dist_zero_right] at ha₂ hb₂
refine ⟨cfcₙ f (cfcₙ g a + cfcₙ g b), ⟨by simp, ?_⟩, ?_, ?_⟩
· simpa only [Metric.mem_ball, dist_zero_right] using norm_cfcₙ_one_sub_one_add_inv_lt_one _
· exact this a b ha₁ hb₁ ha₂ hb₂
· exact add_comm (cfcₙ g a) (cfcₙ g b) ▸ this b a hb₁ ha₁ hb₂ ha₂
rintro a b ha₁ - ha₂ -
calc
a = cfcₙ (f ∘ g) a := by
conv_lhs => rw [← cfcₙ_id ℝ≥0 a]
refine cfcₙ_congr (Set.InvOn.one_sub_one_add_inv.1.eqOn.symm.mono fun x hx ↦ ?_)
exact lt_of_le_of_lt (le_nnnorm_of_mem_quasispectrum hx) ha₂
_ = cfcₙ f (cfcₙ g a) := by
rw [cfcₙ_comp f g a ?_ (by simp [f, tsub_self]) ?_ (by simp [g]) ha₁]
· fun_prop (disch := intro _ _; positivity)
· have (x) (hx : x ∈ σₙ ℝ≥0 a) : 1 - x ≠ 0 := by
refine tsub_pos_of_lt ?_ |>.ne'
exact lt_of_le_of_lt (le_nnnorm_of_mem_quasispectrum hx) ha₂
fun_prop (disch := assumption)
_ ≤ cfcₙ f (cfcₙ g a + cfcₙ g b) := by
have hab' : cfcₙ g a ≤ cfcₙ g a + cfcₙ g b := le_add_of_nonneg_right cfcₙ_nonneg_of_predicate
exact CFC.monotoneOn_one_sub_one_add_inv cfcₙ_nonneg_of_predicate
(cfcₙ_nonneg_of_predicate.trans hab') hab'
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ instance IsStarNormal.instNonUnitalContinuousFunctionalCalculus {A : Type*}
[NonUnitalCStarAlgebra A] : NonUnitalContinuousFunctionalCalculus ℂ (IsStarNormal : A → Prop) :=
RCLike.nonUnitalContinuousFunctionalCalculus Unitization.isStarNormal_inr

open Unitization in
open Unitization CStarAlgebra in
lemma inr_comp_cfcₙHom_eq_cfcₙAux {A : Type*} [NonUnitalCStarAlgebra A] (a : A)
[ha : IsStarNormal a] : (inrNonUnitalStarAlgHom ℂ A).comp (cfcₙHom ha) =
cfcₙAux (isStarNormal_inr (R := ℂ) (A := A)) a ha := by
have h (a : A) := isStarNormal_inr (R := ℂ) (A := A) (a := a)
refine @UniqueNonUnitalContinuousFunctionalCalculus.eq_of_continuous_of_map_id
_ _ _ _ _ _ _ _ _ _ _ inferInstance inferInstance _ (σₙ ℂ a) _ _ rfl _ _ ?_ ?_ ?_
· show Continuous (fun f ↦ (cfcₙHom ha f : Unitization ℂ A)); fun_prop
· show Continuous (fun f ↦ (cfcₙHom ha f : A⁺¹)); fun_prop
· exact isClosedEmbedding_cfcₙAux @(h) a ha |>.continuous
· trans (a : Unitization ℂ A)
· trans (a : A⁺¹)
· congrm(inr $(cfcₙHom_id ha))
· exact cfcₙAux_id @(h) a ha |>.symm

Expand Down Expand Up @@ -586,12 +586,13 @@ section NonnegSpectrumClass

variable {A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] [StarOrderedRing A]

open scoped CStarAlgebra in
instance CStarAlgebra.instNonnegSpectrumClass' : NonnegSpectrumClass ℝ A where
quasispectrum_nonneg_of_nonneg a ha := by
rw [Unitization.quasispectrum_eq_spectrum_inr' _ ℂ]
-- should this actually be an instance on the `Unitization`? (probably scoped)
let _ := CStarAlgebra.spectralOrder (Unitization ℂ A)
have := CStarAlgebra.spectralOrderedRing (Unitization ℂ A)
let _ := CStarAlgebra.spectralOrder A⁺¹
have := CStarAlgebra.spectralOrderedRing A⁺¹
apply spectrum_nonneg_of_nonneg
rw [StarOrderedRing.nonneg_iff] at ha ⊢
have := AddSubmonoid.mem_map_of_mem (Unitization.inrNonUnitalStarAlgHom ℂ A) ha
Expand Down Expand Up @@ -693,4 +694,43 @@ lemma cfcₙ_nnreal_eq_real {a : A} (f : ℝ≥0 → ℝ≥0) (ha : 0 ≤ a := b

end NNRealEqRealNonUnital

section cfc_inr

open CStarAlgebra

variable {A : Type*} [NonUnitalCStarAlgebra A]

open scoped NonUnitalContinuousFunctionalCalculus in
/-- This lemma requires a lot from type class synthesis, and so one should instead favor the bespoke
versions for `ℝ≥0`, `ℝ`, and `ℂ`. -/
lemma Unitization.cfcₙ_eq_cfc_inr {R : Type*} [Semifield R] [StarRing R] [MetricSpace R]
[TopologicalSemiring R] [ContinuousStar R] [Module R A] [IsScalarTower R A A]
[SMulCommClass R A A] [CompleteSpace R] [Algebra R ℂ] [IsScalarTower R ℂ A]
{p : A → Prop} {p' : A⁺¹ → Prop} [NonUnitalContinuousFunctionalCalculus R p]
[ContinuousFunctionalCalculus R p']
[UniqueNonUnitalContinuousFunctionalCalculus R (Unitization ℂ A)]
(hp : ∀ {a : A}, p' (a : A⁺¹) ↔ p a) (a : A) (f : R → R) (hf₀ : f 0 = 0 := by cfc_zero_tac) :
cfcₙ f a = cfc f (a : A⁺¹) := by
by_cases h : ContinuousOn f (σₙ R a) ∧ p a
· obtain ⟨hf, ha⟩ := h
rw [← cfcₙ_eq_cfc (quasispectrum_inr_eq R ℂ a ▸ hf)]
exact (inrNonUnitalStarAlgHom ℂ A).map_cfcₙ f a
· obtain (hf | ha) := not_and_or.mp h
· rw [cfcₙ_apply_of_not_continuousOn a hf, inr_zero,
cfc_apply_of_not_continuousOn _ (quasispectrum_eq_spectrum_inr' R ℂ a ▸ hf)]
· rw [cfcₙ_apply_of_not_predicate a ha, inr_zero,
cfc_apply_of_not_predicate _ (not_iff_not.mpr hp |>.mpr ha)]

lemma Unitization.complex_cfcₙ_eq_cfc_inr (a : A) (f : ℂ → ℂ) (hf₀ : f 0 = 0 := by cfc_zero_tac) :
cfcₙ f a = cfc f (a : A⁺¹) :=
Unitization.cfcₙ_eq_cfc_inr isStarNormal_inr ..

/-- note: the version for `ℝ≥0`, `Unization.nnreal_cfcₙ_eq_cfc_inr`, can be found in
`Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order` -/
lemma Unitization.real_cfcₙ_eq_cfc_inr (a : A) (f : ℝ → ℝ) (hf₀ : f 0 = 0 := by cfc_zero_tac) :
cfcₙ f a = cfc f (a : A⁺¹) :=
Unitization.cfcₙ_eq_cfc_inr isSelfAdjoint_inr ..

end cfc_inr

end
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ lemma norm_cfc_le_iff (f : 𝕜 → 𝕜) (a : A) {c : ℝ} (hc : 0 ≤ c)
(ha : p a := by cfc_tac) : ‖cfc f a‖ ≤ c ↔ ∀ x ∈ σ 𝕜 a, ‖f x‖ ≤ c :=
⟨fun h _ hx ↦ norm_apply_le_norm_cfc f a hx hf ha |>.trans h, norm_cfc_le hc⟩

lemma norm_cfc_lt {f : 𝕜 → 𝕜} {a : A} {c : ℝ} (hc : 0 < c) (h : ∀ x ∈ σ 𝕜 a, ‖f x‖ < c) :
‖cfc f a‖ < c := by
obtain (_ | _) := subsingleton_or_nontrivial A
· simpa [Subsingleton.elim (cfc f a) 0]
· refine cfc_cases (‖·‖ < c) a f (by simpa) fun hf ha ↦ ?_
simp only [← cfc_apply f a, (IsGreatest.norm_cfc f a hf ha |>.lt_iff)]
rintro - ⟨x, hx, rfl⟩
exact h x hx

lemma norm_cfc_lt_iff (f : 𝕜 → 𝕜) (a : A) {c : ℝ} (hc : 0 < c)
(hf : ContinuousOn f (σ 𝕜 a) := by cfc_cont_tac)
(ha : p a := by cfc_tac) : ‖cfc f a‖ < c ↔ ∀ x ∈ σ 𝕜 a, ‖f x‖ < c :=
⟨fun h _ hx ↦ norm_apply_le_norm_cfc f a hx hf ha |>.trans_lt h, norm_cfc_lt hc⟩

open NNReal

lemma nnnorm_cfc_le {f : 𝕜 → 𝕜} {a : A} (c : ℝ≥0) (h : ∀ x ∈ σ 𝕜 a, ‖f x‖₊ ≤ c) :
Expand All @@ -117,6 +131,15 @@ lemma nnnorm_cfc_le_iff (f : 𝕜 → 𝕜) (a : A) (c : ℝ≥0)
(ha : p a := by cfc_tac) : ‖cfc f a‖₊ ≤ c ↔ ∀ x ∈ σ 𝕜 a, ‖f x‖₊ ≤ c :=
norm_cfc_le_iff f a c.2

lemma nnnorm_cfc_lt {f : 𝕜 → 𝕜} {a : A} {c : ℝ≥0} (hc : 0 < c) (h : ∀ x ∈ σ 𝕜 a, ‖f x‖₊ < c) :
‖cfc f a‖₊ < c :=
norm_cfc_lt hc h

lemma nnnorm_cfc_lt_iff (f : 𝕜 → 𝕜) (a : A) {c : ℝ≥0} (hc : 0 < c)
(hf : ContinuousOn f (σ 𝕜 a) := by cfc_cont_tac)
(ha : p a := by cfc_tac) : ‖cfc f a‖₊ < c ↔ ∀ x ∈ σ 𝕜 a, ‖f x‖₊ < c :=
norm_cfc_lt_iff f a hc

end NormedRing

namespace SpectrumRestricts
Expand Down Expand Up @@ -251,6 +274,19 @@ lemma norm_cfcₙ_le_iff (f : 𝕜 → 𝕜) (a : A) (c : ℝ)
(ha : p a := by cfc_tac) : ‖cfcₙ f a‖ ≤ c ↔ ∀ x ∈ σₙ 𝕜 a, ‖f x‖ ≤ c :=
⟨fun h _ hx ↦ norm_apply_le_norm_cfcₙ f a hx hf hf₀ ha |>.trans h, norm_cfcₙ_le⟩

lemma norm_cfcₙ_lt {f : 𝕜 → 𝕜} {a : A} {c : ℝ} (h : ∀ x ∈ σₙ 𝕜 a, ‖f x‖ < c) :
‖cfcₙ f a‖ < c := by
refine cfcₙ_cases (‖·‖ < c) a f ?_ fun hf hf0 ha ↦ ?_
· simpa using (norm_nonneg _).trans_lt <| h 0 (quasispectrum.zero_mem 𝕜 a)
· simp only [← cfcₙ_apply f a, (IsGreatest.norm_cfcₙ f a hf hf0 ha |>.lt_iff)]
rintro - ⟨x, hx, rfl⟩
exact h x hx

lemma norm_cfcₙ_lt_iff (f : 𝕜 → 𝕜) (a : A) (c : ℝ)
(hf : ContinuousOn f (σₙ 𝕜 a) := by cfc_cont_tac) (hf₀ : f 0 = 0 := by cfc_zero_tac)
(ha : p a := by cfc_tac) : ‖cfcₙ f a‖ < c ↔ ∀ x ∈ σₙ 𝕜 a, ‖f x‖ < c :=
⟨fun h _ hx ↦ norm_apply_le_norm_cfcₙ f a hx hf hf₀ ha |>.trans_lt h, norm_cfcₙ_lt⟩

open NNReal

lemma nnnorm_cfcₙ_le {f : 𝕜 → 𝕜} {a : A} {c : ℝ≥0} (h : ∀ x ∈ σₙ 𝕜 a, ‖f x‖₊ ≤ c) :
Expand All @@ -262,6 +298,15 @@ lemma nnnorm_cfcₙ_le_iff (f : 𝕜 → 𝕜) (a : A) (c : ℝ≥0)
(ha : p a := by cfc_tac) : ‖cfcₙ f a‖₊ ≤ c ↔ ∀ x ∈ σₙ 𝕜 a, ‖f x‖₊ ≤ c :=
norm_cfcₙ_le_iff f a c.1 hf hf₀ ha

lemma nnnorm_cfcₙ_lt {f : 𝕜 → 𝕜} {a : A} {c : ℝ≥0} (h : ∀ x ∈ σₙ 𝕜 a, ‖f x‖₊ < c) :
‖cfcₙ f a‖₊ < c :=
norm_cfcₙ_lt h

lemma nnnorm_cfcₙ_lt_iff (f : 𝕜 → 𝕜) (a : A) (c : ℝ≥0)
(hf : ContinuousOn f (σₙ 𝕜 a) := by cfc_cont_tac) (hf₀ : f 0 = 0 := by cfc_zero_tac)
(ha : p a := by cfc_tac) : ‖cfcₙ f a‖₊ < c ↔ ∀ x ∈ σₙ 𝕜 a, ‖f x‖₊ < c :=
norm_cfcₙ_lt_iff f a c.1 hf hf₀ ha

end NormedRing

namespace QuasispectrumRestricts
Expand Down Expand Up @@ -442,6 +487,21 @@ lemma nnnorm_cfc_nnreal_le_iff (f : ℝ≥0 → ℝ≥0) (a : A) (c : ℝ≥0)
(ha : 0 ≤ a := by cfc_tac) : ‖cfc f a‖₊ ≤ c ↔ ∀ x ∈ σ ℝ≥0 a, f x ≤ c :=
⟨fun h _ hx ↦ apply_le_nnnorm_cfc_nnreal f a hx hf ha |>.trans h, nnnorm_cfc_nnreal_le⟩

lemma nnnorm_cfc_nnreal_lt {f : ℝ≥0 → ℝ≥0} {a : A} {c : ℝ≥0} (hc : 0 < c)
(h : ∀ x ∈ σ ℝ≥0 a, f x < c) : ‖cfc f a‖₊ < c := by
obtain (_ | _) := subsingleton_or_nontrivial A
· rw [Subsingleton.elim (cfc f a) 0]
simpa
· refine cfc_cases (‖·‖₊ < c) a f (by simpa) fun hf ha ↦ ?_
simp only [← cfc_apply f a, (IsGreatest.nnnorm_cfc_nnreal f a hf ha |>.lt_iff)]
rintro - ⟨x, hx, rfl⟩
exact h x hx

lemma nnnorm_cfc_nnreal_lt_iff (f : ℝ≥0 → ℝ≥0) (a : A) {c : ℝ≥0} (hc : 0 < c)
(hf : ContinuousOn f (σ ℝ≥0 a) := by cfc_cont_tac)
(ha : 0 ≤ a := by cfc_tac) : ‖cfc f a‖₊ < c ↔ ∀ x ∈ σ ℝ≥0 a, f x < c :=
⟨fun h _ hx ↦ apply_le_nnnorm_cfc_nnreal f a hx hf ha |>.trans_lt h, nnnorm_cfc_nnreal_lt hc⟩

end Unital

section NonUnital
Expand Down Expand Up @@ -483,6 +543,19 @@ lemma nnnorm_cfcₙ_nnreal_le_iff (f : ℝ≥0 → ℝ≥0) (a : A) (c : ℝ≥0
(ha : 0 ≤ a := by cfc_tac) : ‖cfcₙ f a‖₊ ≤ c ↔ ∀ x ∈ σₙ ℝ≥0 a, f x ≤ c :=
⟨fun h _ hx ↦ apply_le_nnnorm_cfcₙ_nnreal f a hx hf hf₀ ha |>.trans h, nnnorm_cfcₙ_nnreal_le⟩

lemma nnnorm_cfcₙ_nnreal_lt {f : ℝ≥0 → ℝ≥0} {a : A} {c : ℝ≥0} (h : ∀ x ∈ σₙ ℝ≥0 a, f x < c) :
‖cfcₙ f a‖₊ < c := by
refine cfcₙ_cases (‖·‖₊ < c) a f ?_ fun hf hf0 ha ↦ ?_
· simpa using zero_le (f 0) |>.trans_lt <| h 0 (quasispectrum.zero_mem ℝ≥0 _) -- sorry
· simp only [← cfcₙ_apply f a, (IsGreatest.nnnorm_cfcₙ_nnreal f a hf hf0 ha |>.lt_iff)]
rintro - ⟨x, hx, rfl⟩
exact h x hx

lemma nnnorm_cfcₙ_nnreal_lt_iff (f : ℝ≥0 → ℝ≥0) (a : A) (c : ℝ≥0)
(hf : ContinuousOn f (σₙ ℝ≥0 a) := by cfc_cont_tac) (hf₀ : f 0 = 0 := by cfc_zero_tac)
(ha : 0 ≤ a := by cfc_tac) : ‖cfcₙ f a‖₊ < c ↔ ∀ x ∈ σₙ ℝ≥0 a, f x < c :=
⟨fun h _ hx ↦ apply_le_nnnorm_cfcₙ_nnreal f a hx hf hf₀ ha |>.trans_lt h, nnnorm_cfcₙ_nnreal_lt⟩

end NonUnital

end NNReal
Loading