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

tactic: by_contra H
state_before: ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
⊢ ∃ᶠ (m : ℕ) in atTop, ↑↑μ (s ∩ f^[m] ⁻¹' s) ≠ 0

tactic: simp only [not_frequently, eventually_atTop, Ne.def, Classical.not_not] at H
state_before: ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
H : ¬∃ᶠ (m : ℕ) in atTop, ↑↑μ (s ∩ f^[m] ⁻¹' s) ≠ 0
⊢ False

tactic: rcases H with ⟨N, hN⟩
state_before: ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
H : ∃ a, ∀ (b : ℕ), b ≥ a → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
⊢ False

tactic: induction' N with N ihN
state_before: case intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
⊢ False

tactic: rw [imp_false] at ihN
state_before: case intro.succ
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
ihN : (∀ (b : ℕ), b ≥ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0) → False
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
⊢ False

tactic: push_neg  at ihN
state_before: case intro.succ
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
ihN : ¬∀ (b : ℕ), b ≥ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
⊢ False

tactic: rcases ihN with ⟨n, hn, hμn⟩
state_before: case intro.succ
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
ihN : ∃ b, b ≥ N ∧ ↑↑μ (s ∩ f^[b] ⁻¹' s) ≠ 0
⊢ False

tactic: set T := s ∩ ⋃ n ≥ N + 1, f^[n] ⁻¹' s
state_before: case intro.succ.intro.intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
⊢ False

tactic: have hT : MeasurableSet T :=
  hs.inter (MeasurableSet.biUnion (to_countable _) fun _ _ => hf.measurable.iterate _ hs)
state_before: case intro.succ.intro.intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
⊢ False

tactic: have hμT : μ T = 0 := by
  convert(measure_biUnion_null_iff <| to_countable _).2 hN
  rw [← inter_iUnion₂]
  rfl
state_before: case intro.succ.intro.intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
⊢ False

tactic: have : μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0 := by rwa [measure_diff_null hμT]
state_before: case intro.succ.intro.intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
hμT : ↑↑μ T = 0
⊢ False

tactic: rcases hf.exists_mem_image_mem ((hs.inter (hf.measurable.iterate n hs)).diff hT) this with
  ⟨x, ⟨⟨hxs, _⟩, hxT⟩, m, hm0, ⟨_, hxm⟩, _⟩
state_before: case intro.succ.intro.intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
hμT : ↑↑μ T = 0
this : ↑↑μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0
⊢ False

tactic: refine' hxT ⟨hxs, mem_iUnion₂.2 ⟨n + m, _, _⟩⟩
state_before: case intro.succ.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
hμT : ↑↑μ T = 0
this : ↑↑μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0
x : α
hxT : ¬x ∈ T
hxs : x ∈ s
right✝¹ : x ∈ f^[n] ⁻¹' s
m : ℕ
hm0 : m ≠ 0
right✝ : ¬(f^[m]) x ∈ T
left✝ : (f^[m]) x ∈ s
hxm : (f^[m]) x ∈ f^[n] ⁻¹' s
⊢ False

tactic: apply h0
state_before: case intro.zero
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
hN : ∀ (b : ℕ), b ≥ Nat.zero → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
⊢ False

tactic: simpa using hN 0 le_rfl
state_before: case intro.zero
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
hN : ∀ (b : ℕ), b ≥ Nat.zero → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
⊢ ↑↑μ s = 0

tactic: convert(measure_biUnion_null_iff <| to_countable _).2 hN
state_before: ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
⊢ ↑↑μ T = 0

tactic: rw [← inter_iUnion₂]
state_before: case h.e'_2.h.e'_3
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
⊢ T = ⋃ (i : ℕ) (_ : i ∈ fun i => Nat.le (Nat.succ N) i), s ∩ f^[i] ⁻¹' s

tactic: rfl
state_before: case h.e'_2.h.e'_3
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
⊢ T = s ∩ ⋃ (i : ℕ) (_ : i ∈ fun i => Nat.le (Nat.succ N) i), f^[i] ⁻¹' s

tactic: rwa [measure_diff_null hμT]
state_before: ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
hμT : ↑↑μ T = 0
⊢ ↑↑μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0

tactic: exact add_le_add hn (Nat.one_le_of_lt <| pos_iff_ne_zero.2 hm0)
state_before: case intro.succ.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
hμT : ↑↑μ T = 0
this : ↑↑μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0
x : α
hxT : ¬x ∈ T
hxs : x ∈ s
right✝¹ : x ∈ f^[n] ⁻¹' s
m : ℕ
hm0 : m ≠ 0
right✝ : ¬(f^[m]) x ∈ T
left✝ : (f^[m]) x ∈ s
hxm : (f^[m]) x ∈ f^[n] ⁻¹' s
⊢ n + m ≥ N + 1

tactic: rwa [Set.mem_preimage, ← iterate_add_apply] at hxm
state_before: case intro.succ.intro.intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type ?u.54331
α : Type u_1
inst✝ : MeasurableSpace α
f : α → α
s : Set α
μ : Measure α
hf : Conservative f μ
hs : MeasurableSet s
h0 : ↑↑μ s ≠ 0
N✝ : ℕ
hN✝ : ∀ (b : ℕ), b ≥ N✝ → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
N : ℕ
hN : ∀ (b : ℕ), b ≥ Nat.succ N → ↑↑μ (s ∩ f^[b] ⁻¹' s) = 0
n : ℕ
hn : n ≥ N
hμn : ↑↑μ (s ∩ f^[n] ⁻¹' s) ≠ 0
T : Set α := s ∩ ⋃ (n : ℕ) (_ : n ≥ N + 1), f^[n] ⁻¹' s
hT : MeasurableSet T
hμT : ↑↑μ T = 0
this : ↑↑μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0
x : α
hxT : ¬x ∈ T
hxs : x ∈ s
right✝¹ : x ∈ f^[n] ⁻¹' s
m : ℕ
hm0 : m ≠ 0
right✝ : ¬(f^[m]) x ∈ T
left✝ : (f^[m]) x ∈ s
hxm : (f^[m]) x ∈ f^[n] ⁻¹' s
⊢ x ∈ f^[n + m] ⁻¹' s