-- Mathlib/MeasureTheory/Measure/Portmanteau.lean
theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
    (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i ↦ μs i E) :
    (L.limsup fun i ↦ μs i Eᶜ) ≤ μ Eᶜ

Proof state:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
⊢ limsup (fun i => 1 - (μs i) E) L ≤ 1 - μ E

Tactic:
rw [show (L.limsup fun i : ι ↦ 1 - μs i E) = L.limsup ((fun x ↦ 1 - x) ∘ fun i : ι ↦ μs i E)
    from rfl]

Result:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
⊢ limsup ((fun x => 1 - x) ∘ fun i => (μs i) E) L ≤ 1 - μ E

Proof state:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ

Tactic:
have meas_Ec : μ Eᶜ = 1 - μ E := by
  simpa only [measure_univ] using measure_compl E_mble (measure_lt_top μ E).ne

Result:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ

Proof state:
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ

Tactic:
rcases L.eq_or_neBot with rfl | hne

Result:
case inl
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) ⊥
⊢ limsup (fun i => (μs i) Eᶜ) ⊥ ≤ μ Eᶜ

case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ

Proof state:
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
i : ι
⊢ (μs i) Eᶜ = 1 - (μs i) E

Tactic:
simpa only [measure_univ] using measure_compl E_mble (measure_lt_top (μs i) E).ne

Result:
no goals

Proof state:
case inl
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) ⊥
⊢ limsup (fun i => (μs i) Eᶜ) ⊥ ≤ μ Eᶜ

Tactic:
simp only [limsup_bot, bot_le]

Result:
no goals

Proof state:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
⊢ limsup ((fun x => 1 - x) ∘ fun i => (μs i) E) L ≤ 1 - μ E

Tactic:
have key := antitone_const_tsub.map_liminf_of_continuousAt (F := L)
  (fun i ↦ μs i E) (ENNReal.continuous_sub_left ENNReal.one_ne_top).continuousAt

Result:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
key : 1 - liminf (fun i => (μs i) E) L = limsup ((fun x => 1 - x) ∘ fun i => (μs i) E) L
⊢ limsup ((fun x => 1 - x) ∘ fun i => (μs i) E) L ≤ 1 - μ E

Proof state:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ

Tactic:
simp_rw [meas_Ec, meas_i_Ec]

Result:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
⊢ limsup (fun i => 1 - (μs i) E) L ≤ 1 - μ E

Proof state:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
key : 1 - liminf (fun i => (μs i) E) L = limsup ((fun x => 1 - x) ∘ fun i => (μs i) E) L
⊢ limsup ((fun x => 1 - x) ∘ fun i => (μs i) E) L ≤ 1 - μ E

Tactic:
simpa [← key] using antitone_const_tsub h

Result:
no goals

Proof state:
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
⊢ ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E

Tactic:
intro i

Result:
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
i : ι
⊢ (μs i) Eᶜ = 1 - (μs i) E

Proof state:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ

Tactic:
have meas_i_Ec : ∀ i, μs i Eᶜ = 1 - μs i E := by
  intro i
  simpa only [measure_univ] using measure_compl E_mble (measure_lt_top (μs i) E).ne

Result:
case inr
Ω : Type u_1
inst✝² : MeasurableSpace Ω
ι : Type u_2
L : Filter ι
μ : Measure Ω
μs : ι → Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : ∀ (i : ι), IsProbabilityMeasure (μs i)
E : Set Ω
E_mble : MeasurableSet E
h : μ E ≤ liminf (fun i => (μs i) E) L
hne : L.NeBot
meas_Ec : μ Eᶜ = 1 - μ E
meas_i_Ec : ∀ (i : ι), (μs i) Eᶜ = 1 - (μs i) E
⊢ limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ