Theorem: MeasureTheory.measure_iUnion_eq_iSup
File: Mathlib/MeasureTheory/Measure/MeasureSpace.lean

tactic: cases nonempty_encodable ι
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
inst✝ : Countable ι
s : ι → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) s
⊢ μ (⋃ i, s i) = ⨆ i, μ (s i)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
inst✝ : Countable ι
s : ι → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) s
val✝ : Encodable ι
⊢ μ (⋃ i, s i) = ⨆ i, μ (s i)

tactic: generalize ht : Function.extend Encodable.encode s ⊥ = t
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
inst✝ : Countable ι
s : ι → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) s
val✝ : Encodable ι
⊢ μ (⋃ i, s i) = ⨆ i, μ (s i)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
inst✝ : Countable ι
s : ι → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) s
val✝ : Encodable ι
t : ℕ → Set α
ht : Function.extend Encodable.encode s ⊥ = t
⊢ μ (⋃ i, s i) = ⨆ i, μ (s i)

tactic: clear! ι
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
inst✝ : Countable ι
s : ι → Set α
val✝ : Encodable ι
t : ℕ → Set α
ht : Function.extend Encodable.encode s ⊥ = t
hd : Directed (fun x x_1 => x ⊆ x_1) t
⊢ μ (⋃ n, t n) = ⨆ n, μ (t n)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
⊢ μ (⋃ n, t n) = ⨆ n, μ (t n)

tactic: refine le_antisymm ?_ (iSup_le fun i => measure_mono <| subset_iUnion _ _)
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
⊢ μ (⋃ n, t n) = ⨆ n, μ (t n)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)

tactic: set T : ℕ → Set α := fun n => toMeasurable μ (t n)
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)

tactic: set Td : ℕ → Set α := disjointed T
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)

tactic: have hm : ∀ n, MeasurableSet (Td n) :=
  MeasurableSet.disjointed fun n => measurableSet_toMeasurable _ _
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
hm : ∀ (n : ℕ), MeasurableSet (Td n)
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)

tactic: calc
  μ (⋃ n, t n) ≤ μ (⋃ n, T n) := measure_mono (iUnion_mono fun i => subset_toMeasurable _ _)
  _ = μ (⋃ n, Td n) := by rw [iUnion_disjointed]
  _ ≤ ∑' n, μ (Td n) := measure_iUnion_le _
  _ = ⨆ I : Finset ℕ, ∑ n ∈ I, μ (Td n) := ENNReal.tsum_eq_iSup_sum
  _ ≤ ⨆ n, μ (t n) := iSup_le fun I => by
    rcases hd.finset_le I with ⟨N, hN⟩
    calc
      (∑ n ∈ I, μ (Td n)) = μ (⋃ n ∈ I, Td n) :=
        (measure_biUnion_finset ((disjoint_disjointed T).set_pairwise I) fun n _ => hm n).symm
      _ ≤ μ (⋃ n ∈ I, T n) := measure_mono (iUnion₂_mono fun n _hn => disjointed_subset _ _)
      _ = μ (⋃ n ∈ I, t n) := measure_biUnion_toMeasurable I.countable_toSet _
      _ ≤ μ (t N) := measure_mono (iUnion₂_subset hN)
      _ ≤ ⨆ n, μ (t n) := le_iSup (μ ∘ t) N
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
hm : ∀ (n : ℕ), MeasurableSet (Td n)
⊢ μ (⋃ n, t n) ≤ ⨆ n, μ (t n)
state_after: no goals

tactic: exact this.trans (iSup_extend_bot Encodable.encode_injective _)
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
inst✝ : Countable ι
s : ι → Set α
val✝ : Encodable ι
t : ℕ → Set α
ht : Function.extend Encodable.encode s ⊥ = t
hd : Directed (fun x x_1 => x ⊆ x_1) t
this : μ (⨆ i, s i) = ⨆ n, Function.extend Encodable.encode (fun x => μ (s x)) (fun x => 0) n
⊢ μ (⋃ i, s i) = ⨆ i, μ (s i)
state_after: no goals

tactic: rw [iUnion_disjointed]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
hm : ∀ (n : ℕ), MeasurableSet (Td n)
⊢ μ (⋃ n, T n) = μ (⋃ n, Td n)
state_after: no goals

tactic: rcases hd.finset_le I with ⟨N, hN⟩
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
hm : ∀ (n : ℕ), MeasurableSet (Td n)
I : Finset ℕ
⊢ ∑ n ∈ I, μ (Td n) ≤ ⨆ n, μ (t n)
state_after: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
hm : ∀ (n : ℕ), MeasurableSet (Td n)
I : Finset ℕ
N : ℕ
hN : ∀ i ∈ I, t i ⊆ t N
⊢ ∑ n ∈ I, μ (Td n) ≤ ⨆ n, μ (t n)

tactic: calc
  (∑ n ∈ I, μ (Td n)) = μ (⋃ n ∈ I, Td n) :=
    (measure_biUnion_finset ((disjoint_disjointed T).set_pairwise I) fun n _ => hm n).symm
  _ ≤ μ (⋃ n ∈ I, T n) := measure_mono (iUnion₂_mono fun n _hn => disjointed_subset _ _)
  _ = μ (⋃ n ∈ I, t n) := measure_biUnion_toMeasurable I.countable_toSet _
  _ ≤ μ (t N) := measure_mono (iUnion₂_subset hN)
  _ ≤ ⨆ n, μ (t n) := le_iSup (μ ∘ t) N
state_before: case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s s₁ s₂ t✝ : Set α
t : ℕ → Set α
hd : Directed (fun x x_1 => x ⊆ x_1) t
T : ℕ → Set α := fun n => toMeasurable μ (t n)
Td : ℕ → Set α := disjointed T
hm : ∀ (n : ℕ), MeasurableSet (Td n)
I : Finset ℕ
N : ℕ
hN : ∀ i ∈ I, t i ⊆ t N
⊢ ∑ n ∈ I, μ (Td n) ≤ ⨆ n, μ (t n)
state_after: no goals