l3lab/ntp-mathlib huggingface dataset:
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' 

Proof state:
case h₁
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
g : ℕ → Set α
h_meas : ∀ (i : ℕ), MeasurableSet (g i)
h_disj : Pairwise (Disjoint on g)
⊢ ∑' (i : ℕ), ↑↑ν (g i) ≠ ⊤

Next tactic:
rw [← MeasureTheory.measure_iUnion h_disj h_meas]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' 

Proof state:
case h₁
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
g : ℕ → Set α
h_meas : ∀ (i : ℕ), MeasurableSet (g i)
h_disj : Pairwise (Disjoint on g)
⊢ ↑↑ν (⋃ i, g i) ≠ ⊤

Next tactic:
rw [← MeasureTheory.measure_iUnion h_disj h_meas]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' 

Proof state:
case h₂
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
g : ℕ → Set α
h_meas : ∀ (i : ℕ), MeasurableSet (g i)
h_disj : Pairwise (Disjoint on g)
⊢ (fun i => ↑↑ν (g i)) ≤ fun i => ↑↑μ (g i)

Next tactic:
rw [← MeasureTheory.measure_iUnion h_disj h_meas]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      

Proof state:
case h₁
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
g : ℕ → Set α
h_meas : ∀ (i : ℕ), MeasurableSet (g i)
h_disj : Pairwise (Disjoint on g)
⊢ ↑↑ν (⋃ i, g i) ≠ ⊤
case h₂
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
g : ℕ → Set α
h_meas : ∀ (i : ℕ), MeasurableSet (g i)
h_disj : Pairwise (Disjoint on g)
⊢ (fun i => ↑↑ν (g i)) ≤ fun i => ↑↑μ (g i)

Next tactic:
exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  

Proof state:
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
⊢ ↑↑(μ - ν) s = ↑↑μ s - ↑↑ν s

Next tactic:
have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    

Proof state:
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
⊢ ν + measure_sub = μ

Next tactic:
ext1 t h_t_measurable_set
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    

Proof state:
case h
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
t : Set α
h_t_measurable_set : MeasurableSet t
⊢ ↑↑(ν + measure_sub) t = ↑↑μ t

Next tactic:
simp only [Pi.add_apply, coe_add]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    

Proof state:
case h
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
t : Set α
h_t_measurable_set : MeasurableSet t
⊢ ↑↑ν t +
      ↑↑(ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
              (_ :
                ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
                  Pairwise (Disjoint on g) →
                    (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
                      ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i))))
        t =
    ↑↑μ t

Next tactic:
rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  

Proof state:
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ ↑↑(μ - ν) s = ↑↑μ s - ↑↑ν s

Next tactic:
have h_measure_sub_eq : μ - ν = measure_sub := by
    rw [MeasureTheory.Measure.sub_def]
    apply le_antisymm
    · apply sInf_le
      simp [le_refl, add_comm, h_measure_sub_add]
    apply le_sInf
    intro d h_d
    rw [← h_measure_sub_add, mem_setOf_eq, add_comm d] at h_d
    apply Measure.le_of_add_le_add_left h_d
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  have h_measure_sub_eq : μ - ν = measure_sub := by
    

Proof state:
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ μ - ν = measure_sub

Next tactic:
rw [MeasureTheory.Measure.sub_def]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  have h_measure_sub_eq : μ - ν = measure_sub := by
    rw [MeasureTheory.Measure.sub_def]
    

Proof state:
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ sInf {d | μ ≤ d + ν} = measure_sub

Next tactic:
apply le_antisymm
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  have h_measure_sub_eq : μ - ν = measure_sub := by
    rw [MeasureTheory.Measure.sub_def]
    apply le_antisymm
    · 

Proof state:
case a
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ sInf {d | μ ≤ d + ν} ≤ measure_sub

Next tactic:
apply sInf_le
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  have h_measure_sub_eq : μ - ν = measure_sub := by
    rw [MeasureTheory.Measure.sub_def]
    apply le_antisymm
    · apply sInf_le
      

Proof state:
case a.a
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ measure_sub ∈ {d | μ ≤ d + ν}

Next tactic:
simp [le_refl, add_comm, h_measure_sub_add]
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  have h_measure_sub_eq : μ - ν = measure_sub := by
    rw [MeasureTheory.Measure.sub_def]
    apply le_antisymm
    · apply sInf_le
      simp [le_refl, add_comm, h_measure_sub_add]
    

Proof state:
case a
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ measure_sub ≤ sInf {d | μ ≤ d + ν}

Next tactic:
apply le_sInf
/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s := by
  -- We begin by defining `measure_sub`, which will be equal to `(μ - ν)`.
  let measure_sub : Measure α := MeasureTheory.Measure.ofMeasurable
    (fun (t : Set α) (_ : MeasurableSet t) => μ t - ν t) (by simp)
    (by
      intro g h_meas h_disj; simp only; rw [ENNReal.tsum_sub]
      repeat' rw [← MeasureTheory.measure_iUnion h_disj h_meas]
      exacts [MeasureTheory.measure_ne_top _ _, fun i => h₂ _ (h_meas _)])
  -- Now, we demonstrate `μ - ν = measure_sub`, and apply it.
  have h_measure_sub_add : ν + measure_sub = μ := by
    ext1 t h_t_measurable_set
    simp only [Pi.add_apply, coe_add]
    rw [MeasureTheory.Measure.ofMeasurable_apply _ h_t_measurable_set, add_comm,
      tsub_add_cancel_of_le (h₂ t h_t_measurable_set)]
  have h_measure_sub_eq : μ - ν = measure_sub := by
    rw [MeasureTheory.Measure.sub_def]
    apply le_antisymm
    · apply sInf_le
      simp [le_refl, add_comm, h_measure_sub_add]
    apply le_sInf
    

Proof state:
case a.a
α : Type u_1
m : MeasurableSpace α
μ ν : Measure α
s : Set α
inst✝ : IsFiniteMeasure ν
h₁ : MeasurableSet s
h₂ : ν ≤ μ
measure_sub : Measure α :=
  ofMeasurable (fun t x => ↑↑μ t - ↑↑ν t) (_ : ↑↑μ ∅ - ↑↑ν ∅ = 0)
    (_ :
      ∀ ⦃g : ℕ → Set α⦄ (h_meas : ∀ (i : ℕ), MeasurableSet (g i)),
        Pairwise (Disjoint on g) →
          (fun t x => ↑↑μ t - ↑↑ν t) (⋃ i, g i) (_ : MeasurableSet (⋃ b, g b)) =
            ∑' (i : ℕ), (fun t x => ↑↑μ t - ↑↑ν t) (g i) (_ : MeasurableSet (g i)))
h_measure_sub_add : ν + measure_sub = μ
⊢ ∀ b ∈ {d | μ ≤ d + ν}, measure_sub ≤ b

Next tactic:
intro d h_d