Skip to content

Commit 35e8f57

Browse files
CoolRmalhanwenzhu
andcommitted
refactor(MeasureTheory/RieszMarkovKakutani): Use PositiveLinearMap (#28059)
This PR refactors the unbundled `{Λ : C_c(X, ℝ) →ₗ[ℝ] ℝ} (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f)` in the statement of RMK to the bundled `(Λ : C_c(X, ℝ) →ₚ[ℝ] ℝ)`. Zulip discussion: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Uniqueness.20in.20Riesz.E2.80.93Markov.E2.80.93Kakutani.20representation.20theorem Co-authored-by: Thomas Zhu <29544653+hanwenzhu@users.noreply.github.com>
1 parent b29b02b commit 35e8f57

File tree

5 files changed

+122
-81
lines changed

5 files changed

+122
-81
lines changed

Mathlib/Algebra/Order/Module/PositiveLinearMap.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ instance : FunLike (E₁ →ₚ[R] E₂) E₁ E₂ where
8181
apply DFunLike.coe_injective'
8282
exact h
8383

84+
@[ext]
85+
lemma ext {f g : E₁ →ₚ[R] E₂} (h : ∀ x, f x = g x) : f = g :=
86+
DFunLike.ext f g h
87+
8488
instance : LinearMapClass (E₁ →ₚ[R] E₂) R E₁ E₂ where
8589
map_add f := map_add f.toLinearMap
8690
map_smulₛₗ f := f.toLinearMap.map_smul'

Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,10 @@ lemma CompactlySupportedContinuousMap.monotone_of_nnreal : Monotone Λ := by
4848
simp
4949

5050
/-- The positivity of a linear functional `Λ` implies that `Λ` is monotone. -/
51+
@[deprecated PositiveLinearMap.mk₀ (since := "2025-08-08")]
5152
lemma CompactlySupportedContinuousMap.monotone_of_nonneg {Λ : C_c(X, ℝ) →ₗ[ℝ] ℝ}
52-
(hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) : Monotone Λ := by
53-
intro f₁ f₂ h
54-
have : 0 ≤ Λ (f₂ - f₁) := by
55-
apply hΛ
56-
intro x
57-
simp only [coe_zero, Pi.zero_apply, coe_sub, Pi.sub_apply, sub_nonneg]
58-
exact h x
59-
calc Λ f₁ ≤ Λ f₁ + Λ (f₂ - f₁) := by exact (le_add_iff_nonneg_right (Λ f₁)).mpr this
60-
_ = Λ (f₁ + (f₂ - f₁)) := by exact Eq.symm (LinearMap.map_add Λ f₁ (f₂ - f₁))
61-
_ = Λ f₂ := by congr; exact add_sub_cancel f₁ f₂
53+
(hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) : Monotone Λ :=
54+
(PositiveLinearMap.mk₀ Λ hΛ).monotone
6255

6356
end Monotone
6457

Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/NNReal.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ namespace NNRealRMK
3939
the (Bochner) integral of `f` (as a `ℝ`-valued function) with respect to the `rieszMeasure`
4040
associated to `Λ` is equal to `Λ f`. -/
4141
theorem integral_rieszMeasure (f : C_c(X, ℝ≥0)) : ∫ (x : X), (f x : ℝ) ∂(rieszMeasure Λ) = Λ f := by
42-
rw [← eq_toRealLinear_toReal Λ f,
43-
← RealRMK.integral_rieszMeasure (toRealLinear_nonneg Λ) f.toReal]
42+
rw [← eq_toRealPositiveLinear_toReal Λ f,
43+
← RealRMK.integral_rieszMeasure (toRealPositiveLinear Λ) f.toReal]
4444
simp [RealRMK.rieszMeasure, NNRealRMK.rieszMeasure]
4545

4646
/-- The **Riesz-Markov-Kakutani representation theorem**: given a positive linear functional `Λ`,

Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Copyright (c) 2024 Yoh Tanimoto. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yoh Tanimoto, Oliver Butterley
55
-/
6-
import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic
76
import Mathlib.MeasureTheory.Integral.Bochner.Set
7+
import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic
88
import Mathlib.Order.Interval.Set.Union
99

1010
/-!
@@ -45,41 +45,43 @@ namespace RealRMK
4545

4646
variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] [MeasurableSpace X]
4747
[BorelSpace X]
48-
variable {Λ : C_c(X, ℝ) →[ℝ] ℝ} (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f)
48+
variable (Λ : C_c(X, ℝ) →[ℝ] ℝ)
4949

5050
/-- The measure induced for `Real`-linear positive functional `Λ`, defined through `toNNRealLinear`
5151
and the `NNReal`-version of `rieszContent`. This is under the namespace `RealRMK`, while
5252
`rieszMeasure` without namespace is for `NNReal`-linear `Λ`. -/
53-
noncomputable def rieszMeasure := (rieszContent (toNNRealLinear Λ)).measure
53+
noncomputable def rieszMeasure := (rieszContent (toNNRealLinear Λ)).measure
5454

5555
/-- If `f` assumes values between `0` and `1` and the support is contained in `V`, then
5656
`Λ f ≤ rieszMeasure V`. -/
5757
lemma le_rieszMeasure_tsupport_subset {f : C_c(X, ℝ)} (hf : ∀ (x : X), 0 ≤ f x ∧ f x ≤ 1)
58-
{V : Set X} (hV : tsupport f ⊆ V) : ENNReal.ofReal (Λ f) ≤ rieszMeasure V := by
58+
{V : Set X} (hV : tsupport f ⊆ V) : ENNReal.ofReal (Λ f) ≤ rieszMeasure Λ V := by
5959
apply le_trans _ (measure_mono hV)
60-
have := Content.measure_eq_content_of_regular (rieszContent (toNNRealLinear Λ))
61-
(contentRegular_rieszContent (toNNRealLinear Λ)) (⟨tsupport f, f.hasCompactSupport⟩)
60+
have := Content.measure_eq_content_of_regular (rieszContent (toNNRealLinear Λ))
61+
(contentRegular_rieszContent (toNNRealLinear Λ)) (⟨tsupport f, f.hasCompactSupport⟩)
6262
rw [← Compacts.coe_mk (tsupport f) f.hasCompactSupport, rieszMeasure, this, rieszContent,
63-
ENNReal.ofReal_eq_coe_nnreal (hΛ f fun x ↦ (hf x).1), Content.mk_apply, ENNReal.coe_le_coe]
63+
ENNReal.ofReal_eq_coe_nnreal (Λ.map_nonneg fun x ↦ (hf x).1), Content.mk_apply,
64+
ENNReal.coe_le_coe]
6465
apply le_iff_forall_pos_le_add.mpr
6566
intro _ hε
66-
obtain ⟨g, hg⟩ := exists_lt_rieszContentAux_add_pos (toNNRealLinear Λ)
67+
obtain ⟨g, hg⟩ := exists_lt_rieszContentAux_add_pos (toNNRealLinear Λ)
6768
⟨tsupport f, f.hasCompactSupport⟩ (Real.toNNReal_pos.mpr hε)
6869
simp_rw [NNReal.val_eq_coe, Real.toNNReal_coe] at hg
69-
refine (monotone_of_nonneg hΛ ?_).trans hg.2.le
70+
refine (Λ.mono ?_).trans hg.2.le
7071
intro x
7172
by_cases hx : x ∈ tsupport f
7273
· simpa using le_trans (hf x).2 (hg.1 x hx)
7374
· simp [image_eq_zero_of_notMem_tsupport hx]
7475

7576
/-- If `f` assumes the value `1` on a compact set `K` then `rieszMeasure K ≤ Λ f`. -/
7677
lemma rieszMeasure_le_of_eq_one {f : C_c(X, ℝ)} (hf : ∀ x, 0 ≤ f x) {K : Set X}
77-
(hK : IsCompact K) (hfK : ∀ x ∈ K, f x = 1) : rieszMeasure K ≤ ENNReal.ofReal (Λ f) := by
78+
(hK : IsCompact K) (hfK : ∀ x ∈ K, f x = 1) : rieszMeasure Λ K ≤ ENNReal.ofReal (Λ f) := by
7879
rw [← Compacts.coe_mk K hK, rieszMeasure,
79-
Content.measure_eq_content_of_regular _ (contentRegular_rieszContent (toNNRealLinear Λ))]
80+
Content.measure_eq_content_of_regular _ (contentRegular_rieszContent (toNNRealLinear Λ))]
8081
apply ENNReal.coe_le_iff.mpr
8182
intro p hp
82-
rw [← ENNReal.ofReal_coe_nnreal, ENNReal.ofReal_eq_ofReal_iff (hΛ f hf) NNReal.zero_le_coe] at hp
83+
rw [← ENNReal.ofReal_coe_nnreal,
84+
ENNReal.ofReal_eq_ofReal_iff (Λ.map_nonneg hf) NNReal.zero_le_coe] at hp
8385
apply csInf_le'
8486
rw [Set.mem_image]
8587
use f.nnrealPart
@@ -171,8 +173,8 @@ private lemma exists_nat_large (a' b' : ℝ) {ε : ℝ} (hε : 0 < ε) : ∃ (N
171173

172174
/-- The main estimate in the proof of the Riesz-Markov-Kakutani: `Λ f` is bounded above by the
173175
integral of `f` with respect to the `rieszMeasure` associated to `Λ`. -/
174-
private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rieszMeasure ) := by
175-
let μ := rieszMeasure
176+
private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rieszMeasure Λ) := by
177+
let μ := rieszMeasure Λ
176178
let K := tsupport f
177179
-- Suffices to show that `Λ f ≤ ∫ x, f x ∂μ + ε` for arbitrary `ε`.
178180
apply le_iff_forall_pos_le_add.mpr
@@ -207,7 +209,7 @@ private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rie
207209
have h_ε' := (div_pos hε'.1 (Nat.cast_pos'.mpr hN))
208210
have h n x (hx : x ∈ E n) := lt_add_of_le_of_pos ((hE.2.2.1 n x hx).right) hε'.1
209211
have h' n := Eq.trans_ne
210-
(Content.measure_apply (rieszContent (toNNRealLinear Λ)) (hE.2.2.2 n)).symm (hE' n)
212+
(Content.measure_apply (rieszContent (toNNRealLinear Λ)) (hE.2.2.2 n)).symm (hE' n)
211213
choose V hV using fun n ↦ exists_open_approx f h_ε' (E n) (h' n) (hE.2.2.2 n) (h n)
212214
exact ⟨V, hV⟩
213215
-- Define a partition of unity subordinated to the sets `V`
@@ -244,7 +246,6 @@ private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rie
244246
· simp [image_eq_zero_of_notMem_tsupport hx]
245247
· -- Use that `f ≤ y n + ε'` on `V n`
246248
gcongr with n hn
247-
apply monotone_of_nonneg hΛ
248249
intro x
249250
by_cases hx : x ∈ tsupport (g n)
250251
· rw [smul_eq_mul, mul_comm]
@@ -261,7 +262,7 @@ private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rie
261262
· calc
262263
_ ≤ μ.real (V n) := by
263264
apply (ENNReal.ofReal_le_iff_le_toReal _).mp
264-
· exact le_rieszMeasure_tsupport_subset (fun x ↦ hg.2.2.1 n x) (hg.1 n)
265+
· exact le_rieszMeasure_tsupport_subset Λ (fun x ↦ hg.2.2.1 n x) (hg.1 n)
265266
· rw [← lt_top_iff_ne_top]
266267
apply lt_of_le_of_lt (hV n).2.2
267268
rw [WithTop.add_lt_top]
@@ -275,9 +276,9 @@ private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rie
275276
rw [← map_sum Λ g _]
276277
have h x : 0 ≤ (∑ n, g n) x := by simpa using Fintype.sum_nonneg fun n ↦ (hg.2.2.1 n x).1
277278
apply ENNReal.toReal_le_of_le_ofReal
278-
· exact hΛ (∑ n, g n) (fun x ↦ h x)
279+
· exact Λ.map_nonneg (fun x ↦ h x)
279280
· have h' x (hx : x ∈ K) : (∑ n, g n) x = 1 := by simp [hg.2.1 hx]
280-
refine rieszMeasure_le_of_eq_one h f.2 h'
281+
refine rieszMeasure_le_of_eq_one Λ h f.2 h'
281282
· -- Rearrange the sums
282283
have (n : Fin N) : (|a| + y n + ε') * μ.real (E n) =
283284
(|a| + 2 * ε') * μ.real (E n) + (y n - ε') * μ.real (E n) := by linarith
@@ -324,16 +325,15 @@ private lemma integral_riesz_aux (f : C_c(X, ℝ)) : Λ f ≤ ∫ x, f x ∂(rie
324325

325326
/-- The **Riesz-Markov-Kakutani representation theorem**: given a positive linear functional `Λ`,
326327
the integral of `f` with respect to the `rieszMeasure` associated to `Λ` is equal to `Λ f`. -/
327-
theorem integral_rieszMeasure (f : C_c(X, ℝ)) : ∫ x, f x ∂(rieszMeasure ) = Λ f := by
328+
theorem integral_rieszMeasure (f : C_c(X, ℝ)) : ∫ x, f x ∂(rieszMeasure Λ) = Λ f := by
328329
-- We apply the result `Λ f ≤ ∫ x, f x ∂(rieszMeasure hΛ)` to `f` and `-f`.
329330
apply le_antisymm
330331
-- prove the inequality for `- f`
331332
· calc
332-
_ = - ∫ x, (-f) x ∂(rieszMeasure hΛ) := by simpa using integral_neg' (-f)
333-
_ ≤ - Λ (-f) := neg_le_neg (integral_riesz_aux hΛ (-f))
334-
_ = Λ (- -f) := Eq.symm (LinearMap.map_neg Λ (- f))
335-
_ = _ := by rw [neg_neg]
333+
_ = - ∫ x, (-f) x ∂(rieszMeasure Λ) := by simpa using integral_neg' (-f)
334+
_ ≤ - Λ (-f) := neg_le_neg (integral_riesz_aux Λ (-f))
335+
_ = _ := by simp
336336
-- prove the inequality for `f`
337-
· exact integral_riesz_aux f
337+
· exact integral_riesz_aux Λ f
338338

339339
end RealRMK

Mathlib/Topology/ContinuousMap/CompactlySupported.lean

Lines changed: 88 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2024 Yoh Tanimoto. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yoh Tanimoto
55
-/
6+
import Mathlib.Algebra.Order.Module.PositiveLinearMap
67
import Mathlib.Topology.Algebra.Order.Support
78
import Mathlib.Topology.ContinuousMap.ZeroAtInfty
89

@@ -488,14 +489,42 @@ end SemilatticeInf
488489

489490
section Lattice
490491

491-
instance [Lattice β] [TopologicalSpace β] [TopologicalLattice β] [Zero β] :
492+
variable [TopologicalSpace β]
493+
494+
instance [Lattice β] [TopologicalLattice β] [Zero β] :
492495
Lattice C_c(α, β) :=
493496
DFunLike.coe_injective.lattice _ coe_sup coe_inf
494497

498+
instance instMulLeftMono [PartialOrder β] [MulZeroClass β] [ContinuousMul β] [MulLeftMono β] :
499+
MulLeftMono C_c(α, β) :=
500+
fun _ _ _ hg₁₂ x => mul_le_mul_left' (hg₁₂ x) _⟩
501+
502+
instance instMulRightMono [PartialOrder β] [MulZeroClass β] [ContinuousMul β] [MulRightMono β] :
503+
MulRightMono C_c(α, β) :=
504+
fun _ _ _ hg₁₂ x => mul_le_mul_right' (hg₁₂ x) _⟩
505+
506+
instance instAddLeftMono [PartialOrder β] [AddZeroClass β] [ContinuousAdd β] [AddLeftMono β] :
507+
AddLeftMono C_c(α, β) :=
508+
fun _ _ _ hg₁₂ x => add_le_add_left (hg₁₂ x) _⟩
509+
510+
instance instAddRightMono [PartialOrder β] [AddZeroClass β] [ContinuousAdd β] [AddRightMono β] :
511+
AddRightMono C_c(α, β) :=
512+
fun _ _ _ hg₁₂ x => add_le_add_right (hg₁₂ x) _⟩
513+
495514
-- TODO transfer this lattice structure to `BoundedContinuousFunction`
496515

497516
end Lattice
498517

518+
section IsOrderedAddMonoid
519+
520+
variable [TopologicalSpace β] [AddCommMonoid β] [ContinuousAdd β]
521+
variable [PartialOrder β] [IsOrderedAddMonoid β]
522+
523+
instance : IsOrderedAddMonoid C_c(α, β) where
524+
add_le_add_left _ _ hfg c := add_le_add_left hfg c
525+
526+
end IsOrderedAddMonoid
527+
499528
/-! ### `C_c` as a functor
500529
501530
For each `β` with sufficient structure, there is a contravariant functor `C_c(-, β)` from the
@@ -764,68 +793,83 @@ lemma nnrealPart_neg_toReal_eq (f : C_c(α, ℝ≥0)) : nnrealPart (-toReal f) =
764793
section toNNRealLinear
765794

766795
/-- For a positive linear functional `Λ : C_c(α, ℝ) → ℝ`, define a `ℝ≥0`-linear map. -/
767-
noncomputable def toNNRealLinear (Λ : C_c(α, ℝ) →[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) :
796+
noncomputable def toNNRealLinear (Λ : C_c(α, ℝ) →[ℝ] ℝ) :
768797
C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0 where
769-
toFun f := ⟨Λ (toRealLinearMap f), hΛ _ <| by simp⟩
798+
toFun f := ⟨Λ (toRealLinearMap f), Λ.map_nonneg (by simp)
770799
map_add' f g := by ext; simp
771800
map_smul' a f := by ext; simp [NNReal.smul_def]
772801

773802
@[simp]
774-
lemma toNNRealLinear_apply (Λ : C_c(α, ℝ) →[ℝ] ℝ) (hΛ) (f : C_c(α, ℝ≥0)) :
775-
toNNRealLinear Λ f = Λ (toReal f) := rfl
803+
lemma toNNRealLinear_apply (Λ : C_c(α, ℝ) →[ℝ] ℝ) (f : C_c(α, ℝ≥0)) :
804+
toNNRealLinear Λ f = Λ (toReal f) := rfl
776805

777806
@[simp]
778-
lemma toNNRealLinear_inj (Λ₁ Λ₂ : C_c(α, ℝ) →[ℝ] ℝ) (hΛ₁ hΛ₂) :
779-
toNNRealLinear Λ₁ hΛ₁ = toNNRealLinear Λ₂ hΛ₂ ↔ Λ₁ = Λ₂ := by
780-
simp only [LinearMap.ext_iff, NNReal.eq_iff, toNNRealLinear_apply]
781-
refine ⟨fun h f ↦ ?_, fun h f ↦ by rw [LinearMap.ext h]⟩
807+
lemma toNNRealLinear_inj (Λ₁ Λ₂ : C_c(α, ℝ) →[ℝ] ℝ) :
808+
toNNRealLinear Λ₁ = toNNRealLinear Λ₂ ↔ Λ₁ = Λ₂ := by
809+
refine ⟨fun h ↦ ?_, fun h ↦ by rw [h]⟩
810+
ext f
782811
rw [← nnrealPart_sub_nnrealPart_neg f]
812+
simp only [LinearMap.ext_iff, NNReal.eq_iff, toNNRealLinear_apply] at h
783813
simp_rw [map_sub, h]
784814

785815
end toNNRealLinear
786816

787-
section toRealLinear
788-
789-
/-- For a positive linear functional `Λ : C_c(α, ℝ≥0) → ℝ≥0`, define a `ℝ`-linear map. -/
790-
noncomputable def toRealLinear (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) : C_c(α, ℝ) →ₗ[ℝ] ℝ where
791-
toFun := fun f => Λ (nnrealPart f) - Λ (nnrealPart (- f))
792-
map_add' f g := by
793-
simp only [neg_add_rev]
794-
obtain ⟨h, hh⟩ := exists_add_nnrealPart_add_eq f g
795-
rw [← add_zero ((Λ (f + g).nnrealPart).toReal - (Λ (-g + -f).nnrealPart).toReal),
796-
← sub_self (Λ h).toReal, sub_add_sub_comm, ← NNReal.coe_add, ← NNReal.coe_add,
797-
← LinearMap.map_add, ← LinearMap.map_add, hh.1, add_comm (-g) (-f), hh.2]
798-
simp only [map_add, NNReal.coe_add]
799-
ring
800-
map_smul' a f := by
801-
rcases le_total 0 a with ha | ha
802-
· rw [RingHom.id_apply, smul_eq_mul, ← (smul_neg a f), nnrealPart_smul_pos f ha,
803-
nnrealPart_smul_pos (-f) ha]
804-
simp [sup_of_le_left ha, mul_sub]
805-
· simp only [RingHom.id_apply, smul_eq_mul, ← (smul_neg a f),
806-
nnrealPart_smul_neg f ha, nnrealPart_smul_neg (-f) ha, map_smul,
807-
NNReal.coe_mul, Real.coe_toNNReal', neg_neg, sup_of_le_left (neg_nonneg.mpr ha)]
808-
ring
809-
810-
lemma toRealLinear_apply {Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0} (f : C_c(α, ℝ)) :
811-
toRealLinear Λ f = Λ (nnrealPart f) - Λ (nnrealPart (-f)) := rfl
812-
813-
lemma toRealLinear_nonneg (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) (g : C_c(α, ℝ)) (hg : 0 ≤ g) :
814-
0 ≤ toRealLinear Λ g := by
815-
simp [toRealLinear_apply, nnrealPart_neg_eq_zero_of_nonneg hg]
817+
section toRealPositiveLinear
818+
819+
/-- For a positive linear functional `Λ : C_c(α, ℝ≥0) → ℝ≥0`, define a positive `ℝ`-linear map. -/
820+
noncomputable def toRealPositiveLinear (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) : C_c(α, ℝ) →ₚ[ℝ] ℝ :=
821+
PositiveLinearMap.mk₀
822+
{ toFun := fun f => Λ (nnrealPart f) - Λ (nnrealPart (- f))
823+
map_add' f g := by
824+
simp only [neg_add_rev]
825+
obtain ⟨h, hh⟩ := exists_add_nnrealPart_add_eq f g
826+
rw [← add_zero ((Λ (f + g).nnrealPart).toReal - (Λ (-g + -f).nnrealPart).toReal),
827+
← sub_self (Λ h).toReal, sub_add_sub_comm, ← NNReal.coe_add, ← NNReal.coe_add,
828+
← LinearMap.map_add, ← LinearMap.map_add, hh.1, add_comm (-g) (-f), hh.2]
829+
simp only [map_add, NNReal.coe_add]
830+
ring
831+
map_smul' a f := by
832+
rcases le_total 0 a with ha | ha
833+
· rw [RingHom.id_apply, smul_eq_mul, ← (smul_neg a f), nnrealPart_smul_pos f ha,
834+
nnrealPart_smul_pos (-f) ha]
835+
simp [sup_of_le_left ha, mul_sub]
836+
· simp only [RingHom.id_apply, smul_eq_mul, ← (smul_neg a f),
837+
nnrealPart_smul_neg f ha, nnrealPart_smul_neg (-f) ha, map_smul,
838+
NNReal.coe_mul, Real.coe_toNNReal', neg_neg, sup_of_le_left (neg_nonneg.mpr ha)]
839+
ring }
840+
(fun g hg ↦ by simp [nnrealPart_neg_eq_zero_of_nonneg hg])
841+
842+
lemma toRealPositiveLinear_apply {Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0} (f : C_c(α, ℝ)) :
843+
toRealPositiveLinear Λ f = Λ (nnrealPart f) - Λ (nnrealPart (-f)) := rfl
816844

817845
@[simp]
818-
lemma eq_toRealLinear_toReal (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) (f : C_c(α, ℝ≥0)) :
819-
toRealLinear Λ (toReal f) = Λ f := by
820-
simp [toRealLinear_apply]
846+
lemma eq_toRealPositiveLinear_toReal (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) (f : C_c(α, ℝ≥0)) :
847+
toRealPositiveLinear Λ (toReal f) = Λ f := by
848+
simp [toRealPositiveLinear_apply]
821849

822850
@[simp]
823-
lemma eq_toNNRealLinear_toRealLinear (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) :
824-
toNNRealLinear (toRealLinear Λ) (toRealLinear_nonneg Λ) = Λ := by
851+
lemma eq_toNNRealLinear_toRealPositiveLinear (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) :
852+
toNNRealLinear (toRealPositiveLinear Λ) = Λ := by
825853
ext f
826854
simp
827855

828-
end toRealLinear
856+
@[deprecated (since := "2025-08-08")]
857+
alias toRealLinear := toRealPositiveLinear
858+
859+
@[deprecated (since := "2025-08-08")]
860+
alias toRealLinear_apply := toRealPositiveLinear_apply
861+
862+
@[deprecated map_nonneg (since := "2025-08-08")]
863+
lemma toRealLinear_nonneg (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) (g : C_c(α, ℝ)) (hg : 0 ≤ g) :
864+
0 ≤ toRealPositiveLinear Λ g := map_nonneg _ hg
865+
866+
@[deprecated (since := "2025-08-08")]
867+
alias eq_toRealLinear_toReal := eq_toRealPositiveLinear_toReal
868+
869+
@[deprecated (since := "2025-08-08")]
870+
alias eq_toNNRealLinear_toRealLinear := eq_toNNRealLinear_toRealPositiveLinear
871+
872+
end toRealPositiveLinear
829873

830874
end CompactlySupportedContinuousMap
831875

0 commit comments

Comments
 (0)