@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Yury Kudryashov
55-/
66module
77
8+ public import Mathlib.Algebra.BigOperators.Finsupp.Basic
89public import Mathlib.Algebra.BigOperators.WithTop
910public import Mathlib.Data.NNReal.Basic
1011public import Mathlib.Data.ENNReal.Inv
@@ -18,41 +19,51 @@ interact with the order structure on `ℝ≥0∞`.
1819
1920public section
2021
21- open Set NNReal ENNReal
22+ open Set NNReal
2223
2324namespace ENNReal
2425
2526variable {a b c d : ℝ≥0 ∞} {r p q : ℝ≥0 }
2627
2728section OperationsAndInfty
2829
29- variable {α : Type *}
30+ variable {ι M : Type *} [Zero M]
3031
3132@ [simp, norm_cast]
32- theorem coe_finsetSum { s : Finset α} { f : α → ℝ≥0 } : ↑(∑ a ∈ s, f a ) = ∑ a ∈ s, (f a : ℝ≥ 0 ∞ ) :=
33- map_sum ofNNRealHom f s
33+ lemma ofNNReal_finsetSum ( s : Finset ι) ( f : ι → ℝ≥0 ) : ↑(∑ i ∈ s, f i ) = ∑ i ∈ s, ofNNReal (f i ) :=
34+ map_sum ofNNRealHom ..
3435
35- @ [deprecated (since := "2026-04-08" )] alias coe_finset_sum := coe_finsetSum
36+ @ [deprecated (since := "2026-06-04" )] alias coe_finsetSum := ofNNReal_finsetSum
37+ @ [deprecated (since := "2026-04-08" )] alias coe_finset_sum := ofNNReal_finsetSum
3638
3739@ [simp, norm_cast]
38- theorem coe_finsetProd { s : Finset α} { f : α → ℝ≥0 } : ↑(∏ a ∈ s, f a) = ∏ a ∈ s, (f a : ℝ≥ 0 ∞) :=
39- map_prod ofNNRealHom f s
40+ lemma ofNNReal_finsetProd ( s : Finset ι) ( f : ι → ℝ≥0 ) :
41+ ↑(∏ i ∈ s, f i) = ∏ i ∈ s, ofNNReal (f i) := map_prod ofNNRealHom f s
4042
41- @ [deprecated (since := "2026-04-08" )] alias coe_finset_prod := coe_finsetProd
43+ @ [deprecated (since := "2026-06-04" )] alias coe_finsetProd := ofNNReal_finsetProd
44+ @ [deprecated (since := "2026-04-08" )] alias coe_finset_prod := ofNNReal_finsetProd
45+
46+ @ [simp, norm_cast]
47+ lemma ofNNReal_finsuppSum (f : ι →₀ M) (g : ι → M → ℝ≥0 ) :
48+ f.sum g = f.sum (fun i m ↦ ofNNReal (g i m)) := map_finsuppSum ofNNRealHom ..
49+
50+ @ [simp, norm_cast]
51+ lemma ofNNReal_finsuppProd (f : ι →₀ M) (g : ι → M → ℝ≥0 ) :
52+ f.prod g = f.prod (fun i m ↦ ofNNReal (g i m)) := map_finsuppProd ofNNRealHom ..
4253
4354@[simp]
44- theorem toNNReal_prod {ι : Type *} { s : Finset ι} { f : ι → ℝ≥0 ∞} :
55+ theorem toNNReal_prod ( s : Finset ι) ( f : ι → ℝ≥0 ∞) :
4556 (∏ i ∈ s, f i).toNNReal = ∏ i ∈ s, (f i).toNNReal :=
4657 map_prod toNNRealHom _ _
4758
4859@[simp]
49- theorem toReal_prod {ι : Type *} { s : Finset ι} { f : ι → ℝ≥0 ∞} :
60+ theorem toReal_prod ( s : Finset ι) ( f : ι → ℝ≥0 ∞) :
5061 (∏ i ∈ s, f i).toReal = ∏ i ∈ s, (f i).toReal :=
5162 map_prod toRealHom _ _
5263
5364theorem ofReal_prod_of_nonneg {α : Type *} {s : Finset α} {f : α → ℝ} (hf : ∀ i, i ∈ s → 0 ≤ f i) :
5465 ENNReal.ofReal (∏ i ∈ s, f i) = ∏ i ∈ s, ENNReal.ofReal (f i) := by
55- simp_rw [ENNReal.ofReal, ← coe_finsetProd , coe_inj]
66+ simp_rw [ENNReal.ofReal, ← ofNNReal_finsetProd , coe_inj]
5667 exact Real.toNNReal_prod_of_nonneg hf
5768
5869theorem iInf_sum {ι α : Type *} {f : ι → α → ℝ≥0 ∞} {s : Finset α} [Nonempty ι]
@@ -98,7 +109,7 @@ theorem lt_top_of_sum_ne_top {s : Finset α} {f : α → ℝ≥0∞} (h : ∑ x
98109infinity -/
99110theorem toNNReal_sum {s : Finset α} {f : α → ℝ≥0 ∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
100111 ENNReal.toNNReal (∑ a ∈ s, f a) = ∑ a ∈ s, ENNReal.toNNReal (f a) := by
101- rw [← coe_inj, coe_toNNReal, coe_finsetSum , sum_congr rfl]
112+ rw [← coe_inj, coe_toNNReal, ofNNReal_finsetSum , sum_congr rfl]
102113 · intro x hx
103114 exact (coe_toNNReal (hf x hx)).symm
104115 · exact sum_ne_top.2 hf
@@ -111,7 +122,7 @@ theorem toReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f
111122
112123theorem ofReal_sum_of_nonneg {s : Finset α} {f : α → ℝ} (hf : ∀ i, i ∈ s → 0 ≤ f i) :
113124 ENNReal.ofReal (∑ i ∈ s, f i) = ∑ i ∈ s, ENNReal.ofReal (f i) := by
114- simp_rw [ENNReal.ofReal, ← coe_finsetSum , coe_inj]
125+ simp_rw [ENNReal.ofReal, ← ofNNReal_finsetSum , coe_inj]
115126 exact Real.toNNReal_sum_of_nonneg hf
116127
117128theorem sum_lt_sum_of_nonempty {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0 ∞}
0 commit comments