l3lab/ntp-mathlib huggingface dataset:
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
      exact Finset.inf'_le _ hyU'
    rw [Set.not_nonempty_iff_eq_empty.mp hU₃]
    simp only [Set.empty_pi, Set.preimage_univ, Set.subset_univ, and_true_iff]
    exact Exists.intro ((p 0).ball 0 1) (p.basisSets_singleton_mem 0 one_pos)
  rintro U (hU : U ∈ p.basisSets)
  rw [SeminormFamily.basisSets_iff] at hU
  rcases hU with ⟨s, r, hr, hU⟩
  rw [hU]
  refine' ⟨(s, fun _ => r), ⟨by simp only [s.finite_toSet], fun y _ => hr⟩, fun x hx => _⟩
  simp only [Set.mem_preimage, Set.mem_pi, Finset.mem_coe, mem_ball_zero_iff] at hx
  simp only [id.def, Seminorm.mem_ball, sub_zero]
  

Proof state:
case refine'_2.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set E
s : Finset F
r : ℝ
hr : 0 < r
hU : U = Seminorm.ball (Finset.sup s p) 0 r
x : E
hx : ∀ i ∈ s, ‖(B x) i‖ < r
⊢ (Finset.sup s (toSeminormFamily B)) x < r

Next tactic:
refine' Seminorm.finset_sup_apply_lt hr fun y hy => _
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
      exact Finset.inf'_le _ hyU'
    rw [Set.not_nonempty_iff_eq_empty.mp hU₃]
    simp only [Set.empty_pi, Set.preimage_univ, Set.subset_univ, and_true_iff]
    exact Exists.intro ((p 0).ball 0 1) (p.basisSets_singleton_mem 0 one_pos)
  rintro U (hU : U ∈ p.basisSets)
  rw [SeminormFamily.basisSets_iff] at hU
  rcases hU with ⟨s, r, hr, hU⟩
  rw [hU]
  refine' ⟨(s, fun _ => r), ⟨by simp only [s.finite_toSet], fun y _ => hr⟩, fun x hx => _⟩
  simp only [Set.mem_preimage, Set.mem_pi, Finset.mem_coe, mem_ball_zero_iff] at hx
  simp only [id.def, Seminorm.mem_ball, sub_zero]
  refine' Seminorm.finset_sup_apply_lt hr fun y hy => _
  

Proof state:
case refine'_2.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set E
s : Finset F
r : ℝ
hr : 0 < r
hU : U = Seminorm.ball (Finset.sup s p) 0 r
x : E
hx : ∀ i ∈ s, ‖(B x) i‖ < r
y : F
hy : y ∈ s
⊢ (toSeminormFamily B y) x < r

Next tactic:
rw [LinearMap.toSeminormFamily_apply]
theorem LinearMap.hasBasis_weakBilin (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) :
    (𝓝 (0 : WeakBilin B)).HasBasis B.toSeminormFamily.basisSets _root_.id := by
  let p := B.toSeminormFamily
  rw [nhds_induced, nhds_pi]
  simp only [map_zero, LinearMap.zero_apply]
  have h := @Metric.nhds_basis_ball 𝕜 _ 0
  have h' := Filter.hasBasis_pi fun _ : F => h
  have h'' := Filter.HasBasis.comap (fun x y => B x y) h'
  refine' h''.to_hasBasis _ _
  · rintro (U : Set F × (F → ℝ)) hU
    cases' hU with hU₁ hU₂
    simp only [id.def]
    let U' := hU₁.toFinset
    by_cases hU₃ : U.fst.Nonempty
    · have hU₃' : U'.Nonempty := hU₁.toFinset_nonempty.mpr hU₃
      refine' ⟨(U'.sup p).ball 0 <| U'.inf' hU₃' U.snd, p.basisSets_mem _ <|
        (Finset.lt_inf'_iff _).2 fun y hy => hU₂ y <| hU₁.mem_toFinset.mp hy, fun x hx y hy => _⟩
      simp only [Set.mem_preimage, Set.mem_pi, mem_ball_zero_iff]
      rw [Seminorm.mem_ball_zero] at hx
      rw [← LinearMap.toSeminormFamily_apply]
      have hyU' : y ∈ U' := (Set.Finite.mem_toFinset hU₁).mpr hy
      have hp : p y ≤ U'.sup p := Finset.le_sup hyU'
      refine' lt_of_le_of_lt (hp x) (lt_of_lt_of_le hx _)
      exact Finset.inf'_le _ hyU'
    rw [Set.not_nonempty_iff_eq_empty.mp hU₃]
    simp only [Set.empty_pi, Set.preimage_univ, Set.subset_univ, and_true_iff]
    exact Exists.intro ((p 0).ball 0 1) (p.basisSets_singleton_mem 0 one_pos)
  rintro U (hU : U ∈ p.basisSets)
  rw [SeminormFamily.basisSets_iff] at hU
  rcases hU with ⟨s, r, hr, hU⟩
  rw [hU]
  refine' ⟨(s, fun _ => r), ⟨by simp only [s.finite_toSet], fun y _ => hr⟩, fun x hx => _⟩
  simp only [Set.mem_preimage, Set.mem_pi, Finset.mem_coe, mem_ball_zero_iff] at hx
  simp only [id.def, Seminorm.mem_ball, sub_zero]
  refine' Seminorm.finset_sup_apply_lt hr fun y hy => _
  rw [LinearMap.toSeminormFamily_apply]
  

Proof state:
case refine'_2.intro.intro.intro
𝕜 : Type u_1
E : Type u_2
F : Type u_3
ι : Type u_4
inst✝⁵ : NormedField 𝕜
inst✝⁴ : AddCommGroup E
inst✝³ : Module 𝕜 E
inst✝² : AddCommGroup F
inst✝¹ : Module 𝕜 F
inst✝ : Nonempty ι
B✝ B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜
p : SeminormFamily 𝕜 E F := toSeminormFamily B
h : Filter.HasBasis (𝓝 0) (fun x => 0 < x) (Metric.ball 0)
h' :
  Filter.HasBasis (Filter.pi fun x => 𝓝 0) (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun If =>
    Set.pi If.1 fun i => Metric.ball 0 (If.2 i)
h'' :
  Filter.HasBasis (Filter.comap (fun x y => (B x) y) (Filter.pi fun x => 𝓝 0))
    (fun If => Set.Finite If.1 ∧ ∀ i ∈ If.1, 0 < If.2 i) fun i =>
    (fun x y => (B x) y) ⁻¹' Set.pi i.1 fun i_1 => Metric.ball 0 (i.2 i_1)
U : Set E
s : Finset F
r : ℝ
hr : 0 < r
hU : U = Seminorm.ball (Finset.sup s p) 0 r
x : E
hx : ∀ i ∈ s, ‖(B x) i‖ < r
y : F
hy : y ∈ s
⊢ ‖(B x) y‖ < r

Next tactic:
exact hx y hy
theorem weightedSMul_apply {m : MeasurableSpace α} (μ : Measure α) (s : Set α) (x : F) :
    weightedSMul μ s x = (μ s).toReal • x := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
s : Set α
x : F
⊢ (weightedSMul μ s) x = ENNReal.toReal (↑↑μ s) • x

Next tactic:
simp [weightedSMul]
@[simp]
theorem weightedSMul_zero_measure {m : MeasurableSpace α} :
    weightedSMul (0 : Measure α) = (0 : Set α → F →L[ℝ] F) := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ : Measure α
m : MeasurableSpace α
⊢ weightedSMul 0 = 0

Next tactic:
ext1
@[simp]
theorem weightedSMul_zero_measure {m : MeasurableSpace α} :
    weightedSMul (0 : Measure α) = (0 : Set α → F →L[ℝ] F) := by ext1; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ : Measure α
m : MeasurableSpace α
x✝ : Set α
⊢ weightedSMul 0 x✝ = OfNat.ofNat 0 x✝

Next tactic:
simp [weightedSMul]
@[simp]
theorem weightedSMul_empty {m : MeasurableSpace α} (μ : Measure α) :
    weightedSMul μ ∅ = (0 : F →L[ℝ] F) := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
⊢ weightedSMul μ ∅ = 0

Next tactic:
ext1 x
@[simp]
theorem weightedSMul_empty {m : MeasurableSpace α} (μ : Measure α) :
    weightedSMul μ ∅ = (0 : F →L[ℝ] F) := by ext1 x; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
x : F
⊢ (weightedSMul μ ∅) x = 0 x

Next tactic:
rw [weightedSMul_apply]
@[simp]
theorem weightedSMul_empty {m : MeasurableSpace α} (μ : Measure α) :
    weightedSMul μ ∅ = (0 : F →L[ℝ] F) := by ext1 x; rw [weightedSMul_apply]; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
x : F
⊢ ENNReal.toReal (↑↑μ ∅) • x = 0 x

Next tactic:
simp
theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
    (hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
    (weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ ν : Measure α
s : Set α
hμs : ↑↑μ s ≠ ⊤
hνs : ↑↑ν s ≠ ⊤
⊢ weightedSMul (μ + ν) s = weightedSMul μ s + weightedSMul ν s

Next tactic:
ext1 x
theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
    (hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
    (weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s := by
  ext1 x
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ ν : Measure α
s : Set α
hμs : ↑↑μ s ≠ ⊤
hνs : ↑↑ν s ≠ ⊤
x : F
⊢ (weightedSMul (μ + ν) s) x = (weightedSMul μ s + weightedSMul ν s) x

Next tactic:
push_cast
theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
    (hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
    (weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s := by
  ext1 x
  push_cast
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ ν : Measure α
s : Set α
hμs : ↑↑μ s ≠ ⊤
hνs : ↑↑ν s ≠ ⊤
x : F
⊢ (weightedSMul (μ + ν) s) x = (⇑(weightedSMul μ s) + ⇑(weightedSMul ν s)) x

Next tactic:
simp_rw [Pi.add_apply, weightedSMul_apply]
theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
    (hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
    (weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s := by
  ext1 x
  push_cast
  simp_rw [Pi.add_apply, weightedSMul_apply]
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ ν : Measure α
s : Set α
hμs : ↑↑μ s ≠ ⊤
hνs : ↑↑ν s ≠ ⊤
x : F
⊢ ENNReal.toReal (↑↑(μ + ν) s) • x = ENNReal.toReal (↑↑μ s) • x + ENNReal.toReal (↑↑ν s) • x

Next tactic:
push_cast
theorem weightedSMul_add_measure {m : MeasurableSpace α} (μ ν : Measure α) {s : Set α}
    (hμs : μ s ≠ ∞) (hνs : ν s ≠ ∞) :
    (weightedSMul (μ + ν) s : F →L[ℝ] F) = weightedSMul μ s + weightedSMul ν s := by
  ext1 x
  push_cast
  simp_rw [Pi.add_apply, weightedSMul_apply]
  push_cast
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ ν : Measure α
s : Set α
hμs : ↑↑μ s ≠ ⊤
hνs : ↑↑ν s ≠ ⊤
x : F
⊢ ENNReal.toReal ((↑↑μ + ↑↑ν) s) • x = ENNReal.toReal (↑↑μ s) • x + ENNReal.toReal (↑↑ν s) • x

Next tactic:
rw [Pi.add_apply, ENNReal.toReal_add hμs hνs, add_smul]
theorem weightedSMul_smul_measure {m : MeasurableSpace α} (μ : Measure α) (c : ℝ≥0∞) {s : Set α} :
    (weightedSMul (c • μ) s : F →L[ℝ] F) = c.toReal • weightedSMul μ s := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
c : ℝ≥0∞
s : Set α
⊢ weightedSMul (c • μ) s = ENNReal.toReal c • weightedSMul μ s

Next tactic:
ext1 x
theorem weightedSMul_smul_measure {m : MeasurableSpace α} (μ : Measure α) (c : ℝ≥0∞) {s : Set α} :
    (weightedSMul (c • μ) s : F →L[ℝ] F) = c.toReal • weightedSMul μ s := by
  ext1 x
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
c : ℝ≥0∞
s : Set α
x : F
⊢ (weightedSMul (c • μ) s) x = (ENNReal.toReal c • weightedSMul μ s) x

Next tactic:
push_cast
theorem weightedSMul_smul_measure {m : MeasurableSpace α} (μ : Measure α) (c : ℝ≥0∞) {s : Set α} :
    (weightedSMul (c • μ) s : F →L[ℝ] F) = c.toReal • weightedSMul μ s := by
  ext1 x
  push_cast
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
c : ℝ≥0∞
s : Set α
x : F
⊢ (weightedSMul (c • μ) s) x = (ENNReal.toReal c • ⇑(weightedSMul μ s)) x

Next tactic:
simp_rw [Pi.smul_apply, weightedSMul_apply]
theorem weightedSMul_smul_measure {m : MeasurableSpace α} (μ : Measure α) (c : ℝ≥0∞) {s : Set α} :
    (weightedSMul (c • μ) s : F →L[ℝ] F) = c.toReal • weightedSMul μ s := by
  ext1 x
  push_cast
  simp_rw [Pi.smul_apply, weightedSMul_apply]
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
c : ℝ≥0∞
s : Set α
x : F
⊢ ENNReal.toReal (↑↑(c • μ) s) • x = ENNReal.toReal c • ENNReal.toReal (↑↑μ s) • x

Next tactic:
push_cast
theorem weightedSMul_smul_measure {m : MeasurableSpace α} (μ : Measure α) (c : ℝ≥0∞) {s : Set α} :
    (weightedSMul (c • μ) s : F →L[ℝ] F) = c.toReal • weightedSMul μ s := by
  ext1 x
  push_cast
  simp_rw [Pi.smul_apply, weightedSMul_apply]
  push_cast
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m✝ : MeasurableSpace α
μ✝ : Measure α
m : MeasurableSpace α
μ : Measure α
c : ℝ≥0∞
s : Set α
x : F
⊢ ENNReal.toReal ((c • ↑↑μ) s) • x = ENNReal.toReal c • ENNReal.toReal (↑↑μ s) • x

Next tactic:
simp_rw [Pi.smul_apply, smul_eq_mul, toReal_mul, smul_smul]
theorem weightedSMul_congr (s t : Set α) (hst : μ s = μ t) :
    (weightedSMul μ s : F →L[ℝ] F) = weightedSMul μ t := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s t : Set α
hst : ↑↑μ s = ↑↑μ t
⊢ weightedSMul μ s = weightedSMul μ t

Next tactic:
ext1 x
theorem weightedSMul_congr (s t : Set α) (hst : μ s = μ t) :
    (weightedSMul μ s : F →L[ℝ] F) = weightedSMul μ t := by
  ext1 x; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s t : Set α
hst : ↑↑μ s = ↑↑μ t
x : F
⊢ (weightedSMul μ s) x = (weightedSMul μ t) x

Next tactic:
simp_rw [weightedSMul_apply]
theorem weightedSMul_congr (s t : Set α) (hst : μ s = μ t) :
    (weightedSMul μ s : F →L[ℝ] F) = weightedSMul μ t := by
  ext1 x; simp_rw [weightedSMul_apply]; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s t : Set α
hst : ↑↑μ s = ↑↑μ t
x : F
⊢ ENNReal.toReal (↑↑μ s) • x = ENNReal.toReal (↑↑μ t) • x

Next tactic:
congr 2
theorem weightedSMul_null {s : Set α} (h_zero : μ s = 0) : (weightedSMul μ s : F →L[ℝ] F) = 0 := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s : Set α
h_zero : ↑↑μ s = 0
⊢ weightedSMul μ s = 0

Next tactic:
ext1 x
theorem weightedSMul_null {s : Set α} (h_zero : μ s = 0) : (weightedSMul μ s : F →L[ℝ] F) = 0 := by
  ext1 x; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s : Set α
h_zero : ↑↑μ s = 0
x : F
⊢ (weightedSMul μ s) x = 0 x

Next tactic:
rw [weightedSMul_apply, h_zero]
theorem weightedSMul_null {s : Set α} (h_zero : μ s = 0) : (weightedSMul μ s : F →L[ℝ] F) = 0 := by
  ext1 x; rw [weightedSMul_apply, h_zero]; 

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s : Set α
h_zero : ↑↑μ s = 0
x : F
⊢ ENNReal.toReal 0 • x = 0 x

Next tactic:
simp
theorem weightedSMul_union' (s t : Set α) (ht : MeasurableSet t) (hs_finite : μ s ≠ ∞)
    (ht_finite : μ t ≠ ∞) (h_inter : s ∩ t = ∅) :
    (weightedSMul μ (s ∪ t) : F →L[ℝ] F) = weightedSMul μ s + weightedSMul μ t := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s t : Set α
ht : MeasurableSet t
hs_finite : ↑↑μ s ≠ ⊤
ht_finite : ↑↑μ t ≠ ⊤
h_inter : s ∩ t = ∅
⊢ weightedSMul μ (s ∪ t) = weightedSMul μ s + weightedSMul μ t

Next tactic:
ext1 x
theorem weightedSMul_union' (s t : Set α) (ht : MeasurableSet t) (hs_finite : μ s ≠ ∞)
    (ht_finite : μ t ≠ ∞) (h_inter : s ∩ t = ∅) :
    (weightedSMul μ (s ∪ t) : F →L[ℝ] F) = weightedSMul μ s + weightedSMul μ t := by
  ext1 x
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s t : Set α
ht : MeasurableSet t
hs_finite : ↑↑μ s ≠ ⊤
ht_finite : ↑↑μ t ≠ ⊤
h_inter : s ∩ t = ∅
x : F
⊢ (weightedSMul μ (s ∪ t)) x = (weightedSMul μ s + weightedSMul μ t) x

Next tactic:
simp_rw [add_apply, weightedSMul_apply,
    measure_union (Set.disjoint_iff_inter_eq_empty.mpr h_inter) ht,
    ENNReal.toReal_add hs_finite ht_finite, add_smul]
theorem weightedSMul_smul [NormedField 𝕜] [NormedSpace 𝕜 F] [SMulCommClass ℝ 𝕜 F] (c : 𝕜)
    (s : Set α) (x : F) : weightedSMul μ s (c • x) = c • weightedSMul μ s x := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁴ : NormedAddCommGroup F
inst✝³ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
inst✝² : NormedField 𝕜
inst✝¹ : NormedSpace 𝕜 F
inst✝ : SMulCommClass ℝ 𝕜 F
c : 𝕜
s : Set α
x : F
⊢ (weightedSMul μ s) (c • x) = c • (weightedSMul μ s) x

Next tactic:
simp_rw [weightedSMul_apply, smul_comm]
theorem weightedSMul_nonneg (s : Set α) (x : ℝ) (hx : 0 ≤ x) : 0 ≤ weightedSMul μ s x := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s : Set α
x : ℝ
hx : 0 ≤ x
⊢ 0 ≤ (weightedSMul μ s) x

Next tactic:
simp only [weightedSMul, Algebra.id.smul_eq_mul, coe_smul', id.def, coe_id', Pi.smul_apply]
theorem weightedSMul_nonneg (s : Set α) (x : ℝ) (hx : 0 ≤ x) : 0 ≤ weightedSMul μ s x := by
  simp only [weightedSMul, Algebra.id.smul_eq_mul, coe_smul', id.def, coe_id', Pi.smul_apply]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
m : MeasurableSpace α
μ : Measure α
s : Set α
x : ℝ
hx : 0 ≤ x
⊢ 0 ≤ ENNReal.toReal (↑↑μ s) * x

Next tactic:
exact mul_nonneg toReal_nonneg hx
theorem posPart_map_norm (f : α →ₛ ℝ) : (posPart f).map norm = posPart f := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
⊢ map norm (posPart f) = posPart f

Next tactic:
ext
theorem posPart_map_norm (f : α →ₛ ℝ) : (posPart f).map norm = posPart f := by
  ext; 

Proof state:
case H
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
a✝ : α
⊢ ↑(map norm (posPart f)) a✝ = ↑(posPart f) a✝

Next tactic:
rw [map_apply, Real.norm_eq_abs, abs_of_nonneg]
theorem posPart_map_norm (f : α →ₛ ℝ) : (posPart f).map norm = posPart f := by
  ext; rw [map_apply, Real.norm_eq_abs, abs_of_nonneg]; 

Proof state:
case H
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
a✝ : α
⊢ 0 ≤ ↑(posPart f) a✝

Next tactic:
exact le_max_right _ _
theorem negPart_map_norm (f : α →ₛ ℝ) : (negPart f).map norm = negPart f := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
⊢ map norm (negPart f) = negPart f

Next tactic:
rw [negPart]
theorem negPart_map_norm (f : α →ₛ ℝ) : (negPart f).map norm = negPart f := by
  rw [negPart]; 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
⊢ map norm (posPart (-f)) = posPart (-f)

Next tactic:
exact posPart_map_norm _
theorem posPart_sub_negPart (f : α →ₛ ℝ) : f.posPart - f.negPart = f := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
⊢ posPart f - negPart f = f

Next tactic:
simp only [posPart, negPart]
theorem posPart_sub_negPart (f : α →ₛ ℝ) : f.posPart - f.negPart = f := by
  simp only [posPart, negPart]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
⊢ map (fun b => max b 0) f - map (fun b => max b 0) (-f) = f

Next tactic:
ext a
theorem posPart_sub_negPart (f : α →ₛ ℝ) : f.posPart - f.negPart = f := by
  simp only [posPart, negPart]
  ext a
  

Proof state:
case H
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
a : α
⊢ ↑(map (fun b => max b 0) f - map (fun b => max b 0) (-f)) a = ↑f a

Next tactic:
rw [coe_sub]
theorem posPart_sub_negPart (f : α →ₛ ℝ) : f.posPart - f.negPart = f := by
  simp only [posPart, negPart]
  ext a
  rw [coe_sub]
  

Proof state:
case H
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝² : LinearOrder E
inst✝¹ : Zero E
inst✝ : MeasurableSpace α
f : α →ₛ ℝ
a : α
⊢ (↑(map (fun b => max b 0) f) - ↑(map (fun b => max b 0) (-f))) a = ↑f a

Next tactic:
exact max_zero_sub_eq_self (f a)