@@ -647,38 +647,107 @@ continuous `ℝ≥0`-valued function. -/
647
647
noncomputable def nnrealPart (f : C_c(α, ℝ)) : C_c(α, ℝ≥0 ) where
648
648
toFun := Real.toNNReal.comp f.toFun
649
649
continuous_toFun := Continuous.comp continuous_real_toNNReal f.continuous
650
- hasCompactSupport' := by
651
- apply HasCompactSupport.comp_left f.hasCompactSupport' Real.toNNReal_zero
650
+ hasCompactSupport' := HasCompactSupport.comp_left f.hasCompactSupport' Real.toNNReal_zero
652
651
653
652
@[simp]
654
653
lemma nnrealPart_apply (f : C_c(α, ℝ)) (x : α) :
655
654
f.nnrealPart x = Real.toNNReal (f x) := rfl
656
655
656
+ lemma nnrealPart_neg_eq_zero_of_nonneg {f : C_c(α, ℝ)} (hf : 0 ≤ f) : (-f).nnrealPart = 0 := by
657
+ ext x
658
+ simpa using hf x
659
+
660
+ lemma nnrealPart_smul_pos (f : C_c(α, ℝ)) {a : ℝ} (ha : 0 ≤ a) :
661
+ (a • f).nnrealPart = a.toNNReal • f.nnrealPart := by
662
+ ext x
663
+ simp only [nnrealPart_apply, coe_smul, Pi.smul_apply, Real.coe_toNNReal', smul_eq_mul,
664
+ NNReal.coe_mul, ha, sup_of_le_left]
665
+ rcases le_total 0 (f x) with hfx | hfx
666
+ · simp [ha, hfx, mul_nonneg]
667
+ · simp [mul_nonpos_iff, ha, hfx]
668
+
669
+ lemma nnrealPart_smul_neg (f : C_c(α, ℝ)) {a : ℝ} (ha : a ≤ 0 ) :
670
+ (a • f).nnrealPart = (-a).toNNReal • (-f).nnrealPart := by
671
+ ext x
672
+ simp only [nnrealPart_apply, coe_smul, Pi.smul_apply, smul_eq_mul, Real.coe_toNNReal', coe_neg,
673
+ Pi.neg_apply, NNReal.coe_mul]
674
+ rcases le_total 0 (f x) with hfx | hfx
675
+ · simp [mul_nonpos_iff, ha, hfx]
676
+ · simp [ha, hfx, mul_nonneg_of_nonpos_of_nonpos]
677
+
678
+ lemma nnrealPart_add_le_add_nnrealPart (f g : C_c(α, ℝ)) :
679
+ (f + g).nnrealPart ≤ f.nnrealPart + g.nnrealPart := by
680
+ intro x
681
+ simpa using Real.toNNReal_add_le
682
+
683
+ lemma exists_add_nnrealPart_add_eq (f g : C_c(α, ℝ)) : ∃ (h : C_c(α, ℝ≥0 )),
684
+ (f + g).nnrealPart + h = f.nnrealPart + g.nnrealPart ∧
685
+ (-f + -g).nnrealPart + h = (-f).nnrealPart + (-g).nnrealPart := by
686
+ obtain ⟨h, hh⟩ := CompactlySupportedContinuousMap.exists_add_of_le
687
+ (nnrealPart_add_le_add_nnrealPart f g)
688
+ use h
689
+ refine ⟨hh, ?_⟩
690
+ ext x
691
+ simp only [coe_add, Pi.add_apply, nnrealPart_apply, coe_neg, Pi.neg_apply, NNReal.coe_add,
692
+ Real.coe_toNNReal', ← neg_add]
693
+ have hhx : (f x + g x) ⊔ 0 + ↑(h x) = f x ⊔ 0 + g x ⊔ 0 := by
694
+ rw [← Real.coe_toNNReal', ← Real.coe_toNNReal', ← Real.coe_toNNReal', ← NNReal.coe_add,
695
+ ← NNReal.coe_add]
696
+ have hhx' : ((f + g).nnrealPart + h) x = (f.nnrealPart + g.nnrealPart) x := by congr
697
+ simp only [coe_add, Pi.add_apply, nnrealPart_apply, Real.coe_toNNReal'] at hhx'
698
+ exact congrArg toReal hhx'
699
+ rcases le_total 0 (f x) with hfx | hfx
700
+ · rcases le_total 0 (g x) with hgx | hgx
701
+ · simp only [hfx, hgx, add_nonneg, sup_of_le_left, add_eq_left, coe_eq_zero] at hhx
702
+ simp [hhx, hfx, hgx, add_nonpos]
703
+ · rcases le_total 0 (f x + g x) with hfgx | hfgx
704
+ · simp only [hfgx, sup_of_le_left, add_assoc, hfx, hgx, sup_of_le_right, add_zero,
705
+ add_eq_left] at hhx
706
+ rw [sup_of_le_right (neg_nonpos.mpr hfx), sup_of_le_left (neg_nonneg.mpr hgx),
707
+ sup_of_le_right (neg_nonpos.mpr hfgx)]
708
+ linarith
709
+ · simp only [hfgx, sup_of_le_right, zero_add, hfx, sup_of_le_left, hgx, add_zero] at hhx
710
+ rw [sup_of_le_right (neg_nonpos.mpr hfx), sup_of_le_left (neg_nonneg.mpr hgx),
711
+ sup_of_le_left (neg_nonneg.mpr hfgx), hhx]
712
+ ring
713
+ · rcases le_total 0 (g x) with hgx | hgx
714
+ · rcases le_total 0 (f x + g x) with hfgx | hfgx
715
+ · simp only [hfgx, sup_of_le_left, add_comm, hfx, sup_of_le_right, hgx, zero_add] at hhx
716
+ rw [sup_of_le_left (neg_nonneg.mpr hfx), sup_of_le_right (neg_nonpos.mpr hgx),
717
+ sup_of_le_right (neg_nonpos.mpr hfgx), zero_add, add_zero]
718
+ linarith
719
+ · simp only [hfgx, sup_of_le_right, zero_add, hfx, hgx, sup_of_le_left] at hhx
720
+ rw [sup_of_le_left (neg_nonneg.mpr hfx), sup_of_le_right (neg_nonpos.mpr hgx),
721
+ sup_of_le_left (neg_nonneg.mpr hfgx), hhx]
722
+ ring
723
+ · simp only [(add_nonpos hfx hgx), sup_of_le_right, zero_add, hfx, hgx, add_zero,
724
+ coe_eq_zero] at hhx
725
+ rw [sup_of_le_left (neg_nonneg.mpr hfx),
726
+ sup_of_le_left (neg_nonneg.mpr hgx),
727
+ sup_of_le_left (neg_nonneg.mpr (add_nonpos hfx hgx)), hhx, neg_add_rev, NNReal.coe_zero,
728
+ add_zero]
729
+ ring
730
+
657
731
/-- The compactly supported continuous `ℝ≥0`-valued function as a compactly supported `ℝ`-valued
658
732
function. -/
659
733
noncomputable def toReal (f : C_c(α, ℝ≥0 )) : C_c(α, ℝ) :=
660
734
f.compLeft ContinuousMap.coeNNRealReal
661
735
662
- @[simp]
663
- lemma toReal_apply (f : C_c(α, ℝ≥0 )) (x : α) : f.toReal x = f x := compLeft_apply rfl _ _
664
-
736
+ @[simp] lemma toReal_apply (f : C_c(α, ℝ≥0 )) (x : α) : f.toReal x = f x := compLeft_apply rfl _ _
665
737
@[simp] lemma toReal_nonneg {f : C_c(α, ℝ≥0 )} : 0 ≤ f.toReal := fun _ ↦ by simp
666
-
667
738
@[simp] lemma toReal_add (f g : C_c(α, ℝ≥0 )) : (f + g).toReal = f.toReal + g.toReal := by ext; simp
668
739
@[simp] lemma toReal_smul (r : ℝ≥0 ) (f : C_c(α, ℝ≥0 )) : (r • f).toReal = r • f.toReal := by
669
740
ext; simp [NNReal.smul_def]
670
741
742
+ @[simp]
671
743
lemma nnrealPart_sub_nnrealPart_neg (f : C_c(α, ℝ)) :
672
- (nnrealPart f).toReal - (nnrealPart (-f)).toReal = f := by
673
- ext x
674
- simp
744
+ (nnrealPart f).toReal - (nnrealPart (-f)).toReal = f := by ext x; simp
675
745
676
- /-- The compactly supported continuous `ℝ≥0`-valued function as a compactly supported `ℝ`-valued
677
- function. -/
746
+ /-- The map `toReal` defined as a `ℝ≥0`-linear map. -/
678
747
noncomputable def toRealLinearMap : C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] C_c(α, ℝ) where
679
748
toFun := toReal
680
749
map_add' f g := by ext x; simp
681
- map_smul' a f := by ext x; simp [NNReal.smul_def]
750
+ map_smul' a f := by ext x; simp
682
751
683
752
@[simp, norm_cast]
684
753
lemma coe_toRealLinearMap : (toRealLinearMap : C_c(α, ℝ≥0 ) → C_c(α, ℝ)) = toReal := rfl
@@ -688,6 +757,14 @@ lemma toRealLinearMap_apply (f : C_c(α, ℝ≥0)) : toRealLinearMap f = f.toRea
688
757
lemma toRealLinearMap_apply_apply (f : C_c(α, ℝ≥0 )) (x : α) :
689
758
toRealLinearMap f x = (f x).toReal := by simp
690
759
760
+ @[simp]
761
+ lemma nnrealPart_toReal_eq (f : C_c(α, ℝ≥0 )) : nnrealPart (toReal f) = f := by ext x; simp
762
+
763
+ @[simp]
764
+ lemma nnrealPart_neg_toReal_eq (f : C_c(α, ℝ≥0 )) : nnrealPart (- toReal f) = 0 := by ext x; simp
765
+
766
+ section toNNRealLinear
767
+
691
768
/-- For a positive linear functional `Λ : C_c(α, ℝ) → ℝ`, define a `ℝ≥0`-linear map. -/
692
769
noncomputable def toNNRealLinear (Λ : C_c(α, ℝ) →ₗ[ℝ] ℝ) (hΛ : ∀ f, 0 ≤ f → 0 ≤ Λ f) :
693
770
C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] ℝ≥0 where
@@ -699,13 +776,59 @@ noncomputable def toNNRealLinear (Λ : C_c(α, ℝ) →ₗ[ℝ] ℝ) (hΛ : ∀
699
776
lemma toNNRealLinear_apply (Λ : C_c(α, ℝ) →ₗ[ℝ] ℝ) (hΛ) (f : C_c(α, ℝ≥0 )) :
700
777
toNNRealLinear Λ hΛ f = Λ (toReal f) := rfl
701
778
702
- @[simp] lemma toNNRealLinear_inj (Λ₁ Λ₂ : C_c(α, ℝ) →ₗ[ℝ] ℝ) (hΛ₁ hΛ₂) :
779
+ @[simp]
780
+ lemma toNNRealLinear_inj (Λ₁ Λ₂ : C_c(α, ℝ) →ₗ[ℝ] ℝ) (hΛ₁ hΛ₂) :
703
781
toNNRealLinear Λ₁ hΛ₁ = toNNRealLinear Λ₂ hΛ₂ ↔ Λ₁ = Λ₂ := by
704
782
simp only [LinearMap.ext_iff, NNReal.eq_iff, toNNRealLinear_apply]
705
783
refine ⟨fun h f ↦ ?_, fun h f ↦ by rw [LinearMap.ext h]⟩
706
784
rw [← nnrealPart_sub_nnrealPart_neg f]
707
785
simp_rw [map_sub, h]
708
786
787
+ end toNNRealLinear
788
+
789
+ section toRealLinear
790
+
791
+ /-- For a positive linear functional `Λ : C_c(α, ℝ≥0) → ℝ≥0`, define a `ℝ`-linear map. -/
792
+ noncomputable def toRealLinear (Λ : C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] ℝ≥0 ) : C_c(α, ℝ) →ₗ[ℝ] ℝ where
793
+ toFun := fun f => Λ (nnrealPart f) - Λ (nnrealPart (- f))
794
+ map_add' f g := by
795
+ simp only [neg_add_rev]
796
+ obtain ⟨h, hh⟩ := exists_add_nnrealPart_add_eq f g
797
+ rw [← add_zero ((Λ (f + g).nnrealPart).toReal - (Λ (-g + -f).nnrealPart).toReal),
798
+ ← sub_self (Λ h).toReal, sub_add_sub_comm, ← NNReal.coe_add, ← NNReal.coe_add,
799
+ ← LinearMap.map_add, ← LinearMap.map_add, hh.1 , add_comm (-g) (-f), hh.2 ]
800
+ simp only [map_add, NNReal.coe_add]
801
+ ring
802
+ map_smul' a f := by
803
+ rcases le_total 0 a with ha | ha
804
+ · rw [RingHom.id_apply, smul_eq_mul, ← (smul_neg a f), nnrealPart_smul_pos f ha,
805
+ nnrealPart_smul_pos (-f) ha]
806
+ simp [sup_of_le_left ha, mul_sub]
807
+ · simp only [RingHom.id_apply, smul_eq_mul, ← (smul_neg a f),
808
+ nnrealPart_smul_neg f ha, nnrealPart_smul_neg (-f) ha, map_smul,
809
+ NNReal.coe_mul, Real.coe_toNNReal', neg_neg, sup_of_le_left (neg_nonneg.mpr ha)]
810
+ ring
811
+
812
+ lemma toRealLinear_apply {Λ : C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] ℝ≥0 } (f : C_c(α, ℝ)) :
813
+ toRealLinear Λ f = Λ (nnrealPart f) - Λ (nnrealPart (-f)) := rfl
814
+
815
+ lemma toRealLinear_nonneg (Λ : C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] ℝ≥0 ) (g : C_c(α, ℝ)) (hg : 0 ≤ g) :
816
+ 0 ≤ toRealLinear Λ g := by
817
+ simp [toRealLinear_apply, nnrealPart_neg_eq_zero_of_nonneg hg]
818
+
819
+ @[simp]
820
+ lemma eq_toRealLinear_toReal (Λ : C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] ℝ≥0 ) (f : C_c(α, ℝ≥0 )) :
821
+ toRealLinear Λ (toReal f) = Λ f:= by
822
+ simp [toRealLinear_apply]
823
+
824
+ @[simp]
825
+ lemma eq_toNNRealLinear_toRealLinear (Λ : C_c(α, ℝ≥0 ) →ₗ[ℝ≥0 ] ℝ≥0 ) :
826
+ toNNRealLinear (toRealLinear Λ) (toRealLinear_nonneg Λ) = Λ := by
827
+ ext f
828
+ simp
829
+
830
+ end toRealLinear
831
+
709
832
end CompactlySupportedContinuousMap
710
833
711
834
end NonnegativePart
0 commit comments