Theorem: MeasureTheory.measurableSet_exists_tendsto
File: Mathlib/MeasureTheory/Constructions/Polish.lean

tactic: by_cases hl : l.NeBot
state_before: α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

tactic: swap
state_before: case pos
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

case neg
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : ¬NeBot l
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

tactic: letI := upgradePolishSpace γ
state_before: case pos
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

tactic: rcases l.exists_antitone_basis with ⟨u, hu⟩
state_before: case pos
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this : UpgradedPolishSpace γ := upgradePolishSpace γ
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

tactic: simp_rw [← cauchy_map_iff_exists_tendsto]
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

tactic: change MeasurableSet { x | _ ∧ _ }
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
⊢ MeasurableSet {x | Cauchy (map (fun n => f n x) l)}

tactic: have :
  ∀ x,
    (map (fun i => f i x) l ×ˢ map (fun i => f i x) l).HasAntitoneBasis fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n) :=
  fun x => hu.map.prod hu.map
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
⊢ MeasurableSet {x | NeBot (map (fun n => f n x) l) ∧ map (fun n => f n x) l ×ˢ map (fun n => f n x) l ≤ uniformity γ}

tactic: simp_rw [and_iff_right (hl.map _),
  Filter.HasBasis.le_basis_iff (this _).toHasBasis Metric.uniformity_basis_dist_inv_nat_succ,
  Set.setOf_forall]
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this✝ : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
this :
  ∀ (x : β),
    HasAntitoneBasis (map (fun i => f i x) l ×ˢ map (fun i => f i x) l) fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n)
⊢ MeasurableSet {x | NeBot (map (fun n => f n x) l) ∧ map (fun n => f n x) l ×ˢ map (fun n => f n x) l ≤ uniformity γ}

tactic: refine' MeasurableSet.biInter Set.countable_univ fun K _ => _
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this✝ : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
this :
  ∀ (x : β),
    HasAntitoneBasis (map (fun i => f i x) l ×ˢ map (fun i => f i x) l) fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n)
⊢ MeasurableSet
    (⋂ (i : ℕ) (_ : True),
      {x |
        ∃ i_2,
          True ∧ ((fun n => f n x) '' u i_2) ×ˢ ((fun n => f n x) '' u i_2) ⊆ {p | dist p.fst p.snd < 1 / (↑i + 1)}})

tactic: simp_rw [Set.setOf_exists, true_and]
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this✝ : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
this :
  ∀ (x : β),
    HasAntitoneBasis (map (fun i => f i x) l ×ˢ map (fun i => f i x) l) fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n)
K : ℕ
x✝ : K ∈ fun i => True
⊢ MeasurableSet
    {x | ∃ i, True ∧ ((fun n => f n x) '' u i) ×ˢ ((fun n => f n x) '' u i) ⊆ {p | dist p.fst p.snd < 1 / (↑K + 1)}}

tactic: refine' MeasurableSet.iUnion fun N => _
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this✝ : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
this :
  ∀ (x : β),
    HasAntitoneBasis (map (fun i => f i x) l ×ˢ map (fun i => f i x) l) fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n)
K : ℕ
x✝ : K ∈ fun i => True
⊢ MeasurableSet
    (⋃ (i : ℕ), {x | ((fun n => f n x) '' u i) ×ˢ ((fun n => f n x) '' u i) ⊆ {p | dist p.fst p.snd < 1 / (↑K + 1)}})

tactic: simp_rw [prod_image_image_eq, image_subset_iff, prod_subset_iff, Set.setOf_forall]
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this✝ : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
this :
  ∀ (x : β),
    HasAntitoneBasis (map (fun i => f i x) l ×ˢ map (fun i => f i x) l) fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n)
K : ℕ
x✝ : K ∈ fun i => True
N : ℕ
⊢ MeasurableSet {x | ((fun n => f n x) '' u N) ×ˢ ((fun n => f n x) '' u N) ⊆ {p | dist p.fst p.snd < 1 / (↑K + 1)}}

tactic: exact
  MeasurableSet.biInter (to_countable (u N)) fun i _ =>
    MeasurableSet.biInter (to_countable (u N)) fun j _ =>
      measurableSet_lt (Measurable.dist (hf i) (hf j)) measurable_const
state_before: case pos.intro
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : NeBot l
this✝ : UpgradedPolishSpace γ := upgradePolishSpace γ
u : ℕ → Set ι
hu : HasAntitoneBasis l u
this :
  ∀ (x : β),
    HasAntitoneBasis (map (fun i => f i x) l ×ˢ map (fun i => f i x) l) fun n =>
      ((fun i => f i x) '' u n) ×ˢ ((fun i => f i x) '' u n)
K : ℕ
x✝ : K ∈ fun i => True
N : ℕ
⊢ MeasurableSet
    (⋂ (i : ι) (_ : i ∈ u N) (i_1 : ι) (_ : i_1 ∈ u N),
      {x | (i, i_1) ∈ (fun p => (f p.fst x, f p.snd x)) ⁻¹' {p | dist p.fst p.snd < 1 / (↑K + 1)}})

tactic: rw [not_neBot] at hl
state_before: case neg
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : ¬NeBot l
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}

tactic: simp [hl]
state_before: case neg
α : Type ?u.327871
inst✝⁷ : TopologicalSpace α
ι : Type u_2
γ : Type u_1
tγ : TopologicalSpace γ
inst✝⁶ : PolishSpace γ
inst✝⁵ : MeasurableSpace γ
hγb : BorelSpace γ
β : Type u_3
tβ : TopologicalSpace β
inst✝⁴ : T2Space β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
s : Set γ
f✝ : γ → β
hγ : OpensMeasurableSpace γ
inst✝¹ : Countable ι
l : Filter ι
inst✝ : IsCountablyGenerated l
f : ι → β → γ
hf : ∀ (i : ι), Measurable (f i)
hl : l = ⊥
⊢ MeasurableSet {x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c)}