Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
  • Loading branch information
eric-wieser and Ruben-VandeVelde committed May 22, 2023
1 parent 02d14be commit c59c263
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
12 changes: 11 additions & 1 deletion Mathlib/Data/Real/ENNReal.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Yury Kudryashov
! This file was ported from Lean 3 source module data.real.ennreal
! leanprover-community/mathlib commit c1686dff26eaecf4efd4edd141ebf78de309ae80
! leanprover-community/mathlib commit ec4b2eeb50364487f80421c0b4c41328a611f30d
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -464,6 +464,7 @@ def ofNNRealHom : ℝ≥0 →+* ℝ≥0∞ where
@[simp] theorem coe_ofNNRealHom : ⇑ofNNRealHom = some := rfl
#align ennreal.coe_of_nnreal_hom ENNReal.coe_ofNNRealHom

-- TODO: generalize some of these (and subsequent lemmas about `smul`) to `WithTop α`
section Actions

/-- A `MulAction` over `ℝ≥0∞` restricts to a `MulAction` over `ℝ≥0`. -/
Expand Down Expand Up @@ -559,6 +560,15 @@ theorem top_mul' : ∞ * a = if a = 0 then 0 else ∞ := by convert WithTop.top_
theorem top_mul_top : ∞ * ∞ = ∞ := WithTop.top_mul_top
#align ennreal.top_mul_top ENNReal.top_mul_top

-- porting note: added missing `DecidableEq R`
theorem smul_top {R} [Zero R] [SMulWithZero R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞]
[NoZeroSMulDivisors R ℝ≥0∞] [DecidableEq R] (c : R) :
c • ∞ = if c = 0 then 0 else ∞ := by
rw [← smul_one_mul, mul_top']
-- porting note: need the primed version of `one_ne_zero` now
simp_rw [smul_eq_zero, or_iff_left (one_ne_zero' ℝ≥0∞)]
#align ennreal.smul_top ENNReal.smul_top

-- porting note: todo: assume `n ≠ 0` instead of `0 < n`
-- porting note: todo: generalize to `WithTop`
theorem top_pow {n : ℕ} (h : 0 < n) : ∞ ^ n = ∞ :=
Expand Down
18 changes: 12 additions & 6 deletions Mathlib/MeasureTheory/Measure/OuterMeasure.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Mario Carneiro
! This file was ported from Lean 3 source module measure_theory.measure.outer_measure
! leanprover-community/mathlib commit 32253a1a1071173b33dc7d6a218cf722c6feb514
! leanprover-community/mathlib commit ec4b2eeb50364487f80421c0b4c41328a611f30d
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -431,11 +431,7 @@ theorem sup_apply (m₁ m₂ : OuterMeasure α) (s : Set α) : (m₁ ⊔ m₂) s

theorem smul_iSup [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] {ι} (f : ι → OuterMeasure α) (c : R) :
(c • ⨆ i, f i) = ⨆ i, c • f i :=
ext fun s => by
rw [smul_apply, ← smul_one_mul, iSup]
simp only [iSup_apply, smul_apply, ← smul_one_mul c (f _ _)]
rw [←iSup, ←ENNReal.mul_iSup]
simp
ext fun s => by simp only [smul_apply, iSup_apply, ENNReal.smul_iSup]
#align measure_theory.outer_measure.smul_supr MeasureTheory.OuterMeasure.smul_iSup

end Supremum
Expand Down Expand Up @@ -1315,6 +1311,16 @@ theorem extend_eq {s : α} (h : P s) : extend m s = m s h := by simp [extend, h]
theorem extend_eq_top {s : α} (h : ¬P s) : extend m s = ∞ := by simp [extend, h]
#align measure_theory.extend_eq_top MeasureTheory.extend_eq_top

theorem smul_extend {R} [Zero R] [SMulWithZero R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞]
[NoZeroSMulDivisors R ℝ≥0∞] {c : R} (hc : c ≠ 0) :
c • extend m = extend fun s h => c • m s h := by
ext1 s
dsimp [extend]
by_cases h : P s
· simp [h]
· simp [h, ENNReal.smul_top, hc]
#align measure_theory.smul_extend MeasureTheory.smul_extend

theorem le_extend {s : α} (h : P s) : m s h ≤ extend m s := by
simp only [extend, le_iInf_iff]
intro
Expand Down
19 changes: 18 additions & 1 deletion Mathlib/Topology/Instances/ENNReal.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module topology.instances.ennreal
! leanprover-community/mathlib commit 90ac7a91781abbb5f0206888d68bd095f88c4229
! leanprover-community/mathlib commit ec4b2eeb50364487f80421c0b4c41328a611f30d
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -656,6 +656,18 @@ theorem iSup_mul {ι : Sort _} {f : ι → ℝ≥0∞} {a : ℝ≥0∞} : iSup f
rw [mul_comm, mul_iSup]; congr; funext; rw [mul_comm]
#align ennreal.supr_mul ENNReal.iSup_mul

theorem smul_iSup {ι : Sort _} {R} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (f : ι → ℝ≥0∞)
(c : R) : (c • ⨆ i, f i) = ⨆ i, c • f i := by
-- Porting note: replaced `iSup _` with `iSup f`
simp only [← smul_one_mul c (f _), ← smul_one_mul c (iSup f), ENNReal.mul_iSup]
#align ennreal.smul_supr ENNReal.smul_iSup

theorem smul_sSup {R} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (s : Set ℝ≥0∞) (c : R) :
c • sSup s = ⨆ i ∈ s, c • i := by
-- Porting note: replaced `_` with `s`
simp_rw [← smul_one_mul c (sSup s), ENNReal.mul_sSup, smul_one_mul]
#align ennreal.smul_Sup ENNReal.smul_sSup

theorem iSup_div {ι : Sort _} {f : ι → ℝ≥0∞} {a : ℝ≥0∞} : iSup f / a = ⨆ i, f i / a :=
iSup_mul
#align ennreal.supr_div ENNReal.iSup_div
Expand Down Expand Up @@ -899,6 +911,11 @@ protected theorem tsum_mul_right : (∑' i, f i * a) = (∑' i, f i) * a := by
simp [mul_comm, ENNReal.tsum_mul_left]
#align ennreal.tsum_mul_right ENNReal.tsum_mul_right

protected theorem tsum_const_smul {R} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (a : R) :
(∑' i, a • f i) = a • ∑' i, f i := by
simpa only [smul_one_mul] using @ENNReal.tsum_mul_left _ (a • (1 : ℝ≥0∞)) _
#align ennreal.tsum_const_smul ENNReal.tsum_const_smul

@[simp]
theorem tsum_iSup_eq {α : Type _} (a : α) {f : α → ℝ≥0∞} : (∑' b : α, ⨆ _h : a = b, f b) = f a :=
(tsum_eq_single a fun _ h => by simp [h.symm]).trans <| by simp
Expand Down

0 comments on commit c59c263

Please sign in to comment.