Theorem: MeasureTheory.FiniteMeasure.testAgainstNN_lipschitz_estimate
File: Mathlib/MeasureTheory/Measure/FiniteMeasure.lean

tactic: simp only [← μ.testAgainstNN_const (nndist f g), ← testAgainstNN_add, ← ENNReal.coe_le_coe,
  BoundedContinuousFunction.coe_add, const_apply, ENNReal.coe_add, Pi.add_apply,
  coe_nnreal_ennreal_nndist, testAgainstNN_coe_eq]
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
⊢ testAgainstNN μ f ≤ testAgainstNN μ g + nndist f g * mass μ

tactic: apply lintegral_mono
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
⊢ (∫⁻ (ω : Ω), ↑(↑f ω) ∂↑μ) ≤ ∫⁻ (ω : Ω), ↑(↑g ω) + edist f g ∂↑μ

tactic: have le_dist : ∀ ω, dist (f ω) (g ω) ≤ nndist f g := BoundedContinuousFunction.dist_coe_le_dist
state_before: case hfg
Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
⊢ (fun a => ↑(↑f a)) ≤ fun a => ↑(↑g a) + edist f g

tactic: intro ω
state_before: case hfg
Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
⊢ (fun a => ↑(↑f a)) ≤ fun a => ↑(↑g a) + edist f g

tactic: have le' : f ω ≤ g ω + nndist f g := by
  apply (NNReal.le_add_nndist (f ω) (g ω)).trans
  rw [add_le_add_iff_left]
  exact dist_le_coe.mp (le_dist ω)
state_before: case hfg
Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
⊢ (fun a => ↑(↑f a)) ω ≤ (fun a => ↑(↑g a) + edist f g) ω

tactic: have le : (f ω : ℝ≥0∞) ≤ (g ω : ℝ≥0∞) + nndist f g := by
  rw [← ENNReal.coe_add];
  exact ENNReal.coe_mono le'
state_before: case hfg
Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
le' : ↑f ω ≤ ↑g ω + nndist f g
⊢ (fun a => ↑(↑f a)) ω ≤ (fun a => ↑(↑g a) + edist f g) ω

tactic: rwa [coe_nnreal_ennreal_nndist] at le
state_before: case hfg
Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
le' : ↑f ω ≤ ↑g ω + nndist f g
le : ↑(↑f ω) ≤ ↑(↑g ω) + ↑(nndist f g)
⊢ (fun a => ↑(↑f a)) ω ≤ (fun a => ↑(↑g a) + edist f g) ω

tactic: apply (NNReal.le_add_nndist (f ω) (g ω)).trans
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
⊢ ↑f ω ≤ ↑g ω + nndist f g

tactic: rw [add_le_add_iff_left]
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
⊢ ↑g ω + nndist (↑f ω) (↑g ω) ≤ ↑g ω + nndist f g

tactic: exact dist_le_coe.mp (le_dist ω)
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
⊢ nndist (↑f ω) (↑g ω) ≤ nndist f g

tactic: rw [← ENNReal.coe_add]
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
le' : ↑f ω ≤ ↑g ω + nndist f g
⊢ ↑(↑f ω) ≤ ↑(↑g ω) + ↑(nndist f g)

tactic: exact ENNReal.coe_mono le'
state_before: Ω : Type u_1
inst✝⁶ : MeasurableSpace Ω
R : Type ?u.76875
inst✝⁵ : SMul R ℝ≥0
inst✝⁴ : SMul R ℝ≥0∞
inst✝³ : IsScalarTower R ℝ≥0 ℝ≥0∞
inst✝² : IsScalarTower R ℝ≥0∞ ℝ≥0∞
inst✝¹ : TopologicalSpace Ω
inst✝ : OpensMeasurableSpace Ω
μ : FiniteMeasure Ω
f g : Ω →ᵇ ℝ≥0
le_dist : ∀ (ω : Ω), dist (↑f ω) (↑g ω) ≤ ↑(nndist f g)
ω : Ω
le' : ↑f ω ≤ ↑g ω + nndist f g
⊢ ↑(↑f ω) ≤ ↑(↑g ω + nndist f g)