Theorem: MeasureTheory.Conservative.measure_mem_forall_ge_image_not_mem_eq_zero
File: Mathlib/Dynamics/Ergodic/Conservative.lean

tactic: by_contra H
state_before: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
⊢ μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
state_after: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
⊢ False

tactic: have : MeasurableSet (s ∩ { x | ∀ m ≥ n, f^[m] x ∉ s }) := by
  simp only [setOf_forall, ← compl_setOf]
  exact
    hs.inter (MeasurableSet.biInter (to_countable _) fun m _ => hf.measurable.iterate m hs.compl)
state_before: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
⊢ False
state_after: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
this : MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
⊢ False

tactic: rcases (hf.exists_gt_measure_inter_ne_zero this H) n with ⟨m, hmn, hm⟩
state_before: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
this : MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
⊢ False
state_after: case intro.intro
ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
this : MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
m : ℕ
hmn : m > n
hm : μ (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s} ∩ f^[m] ⁻¹' (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})) ≠ 0
⊢ False

tactic: rcases nonempty_of_measure_ne_zero hm with ⟨x, ⟨_, hxn⟩, hxm, -⟩
state_before: case intro.intro
ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
this : MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
m : ℕ
hmn : m > n
hm : μ (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s} ∩ f^[m] ⁻¹' (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})) ≠ 0
⊢ False
state_after: case intro.intro.intro.intro.intro.intro
ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
this : MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
m : ℕ
hmn : m > n
hm : μ (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s} ∩ f^[m] ⁻¹' (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})) ≠ 0
x : α
left✝ : x ∈ s
hxn : x ∈ {x | ∀ m ≥ n, f^[m] x ∉ s}
hxm : f^[m] x ∈ s
⊢ False

tactic: exact hxn m hmn.lt.le hxm
state_before: case intro.intro.intro.intro.intro.intro
ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
this : MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
m : ℕ
hmn : m > n
hm : μ (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s} ∩ f^[m] ⁻¹' (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})) ≠ 0
x : α
left✝ : x ∈ s
hxn : x ∈ {x | ∀ m ≥ n, f^[m] x ∉ s}
hxm : f^[m] x ∈ s
⊢ False
state_after: no goals

tactic: simp only [setOf_forall, ← compl_setOf]
state_before: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
⊢ MeasurableSet (s ∩ {x | ∀ m ≥ n, f^[m] x ∉ s})
state_after: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
⊢ MeasurableSet (s ∩ ⋂ i, ⋂ (_ : i ≥ n), {a | f^[i] a ∈ s}ᶜ)

tactic: exact
  hs.inter (MeasurableSet.biInter (to_countable _) fun m _ => hf.measurable.iterate m hs.compl)
state_before: ι : Type u_1
α : Type u_2
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
n : ℕ
H : ¬μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0
⊢ MeasurableSet (s ∩ ⋂ i, ⋂ (_ : i ≥ n), {a | f^[i] a ∈ s}ᶜ)
state_after: no goals