l3lab/ntp-mathlib huggingface dataset:
/-- If either `α` or `β` has second-countable topology, then the open sets in `α × β` belong to the
product sigma-algebra. -/
instance Prod.opensMeasurableSpace [h : SecondCountableTopologyEither α β] :
    OpensMeasurableSpace (α × β) := by
  apply opensMeasurableSpace_iff_forall_measurableSet.2 (fun s hs ↦ ?_)
  rcases h.out with hα|hβ
  · let F : Set α → Set β := fun a ↦ {y | ∃ b, IsOpen b ∧ y ∈ b ∧ a ×ˢ b ⊆ s}
    have A : ∀ a, IsOpen (F a) := by
      intro a
      apply isOpen_iff_forall_mem_open.2
      rintro y ⟨b, b_open, yb, hb⟩
      exact ⟨b, fun z zb ↦ ⟨b, b_open, zb, hb⟩, b_open, yb⟩
    have : s = ⋃ a ∈ countableBasis α, a ×ˢ F a := by
      apply Subset.antisymm
      · rintro ⟨y1, y2⟩ hy
        rcases isOpen_prod_iff.1 hs y1 y2 hy with ⟨u, v, u_open, v_open, yu, yv, huv⟩
        obtain ⟨a, ha, ya, au⟩ : ∃ a ∈ countableBasis α, y1 ∈ a ∧ a ⊆ u :=
          IsTopologicalBasis.exists_subset_of_mem_open (isBasis_countableBasis α) yu u_open
        simp only [mem_iUnion, mem_prod, mem_setOf_eq, exists_and_left, exists_prop]
        exact ⟨a, ya, ha, v, v_open, yv, (Set.prod_mono_left au).trans huv⟩
      · rintro ⟨y1, y2⟩ hy
        simp only [mem_iUnion, mem_prod, mem_setOf_eq, exists_and_left, exists_prop] at hy
        rcases hy with ⟨a, ya, -, b, -, yb, hb⟩
        exact hb (mem_prod.2 ⟨ya, yb⟩)
    rw [this]
    apply MeasurableSet.biUnion (countable_countableBasis α) (fun a ha ↦ ?_)
    exact (isOpen_of_mem_countableBasis ha).measurableSet.prod (A a).measurableSet
  · let F : Set β → Set α := fun a ↦ {y | ∃ b, IsOpen b ∧ y ∈ b ∧ b ×ˢ a ⊆ s}
    have A : ∀ a, IsOpen (F a) := by
      intro a
      apply isOpen_iff_forall_mem_open.2
      rintro y ⟨b, b_open, yb, hb⟩
      exact ⟨b, fun z zb ↦ ⟨b, b_open, zb, hb⟩, b_open, yb⟩
    have : s = ⋃ a ∈ countableBasis β, F a ×ˢ a := by
      apply Subset.antisymm
      · rintro ⟨y1, y2⟩ hy
        rcases isOpen_prod_iff.1 hs y1 y2 hy with ⟨u, v, u_open, v_open, yu, yv, huv⟩
        obtain ⟨a, ha, ya, au⟩ : ∃ a ∈ countableBasis β, y2 ∈ a ∧ a ⊆ v :=
          IsTopologicalBasis.exists_subset_of_mem_open (isBasis_countableBasis β) yv v_open
        simp only [mem_iUnion, mem_prod, mem_setOf_eq, exists_and_left, exists_prop]
        exact ⟨a, ⟨u, u_open, yu, (Set.prod_mono_right au).trans huv⟩, ha, ya⟩
      · rintro ⟨y1, y2⟩ hy
        

Proof state:
case h₂.mk
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t u : Set α
inst✝¹² : TopologicalSpace α
inst✝¹¹ : MeasurableSpace α
inst✝¹⁰ : OpensMeasurableSpace α
inst✝⁹ : TopologicalSpace β
inst✝⁸ : MeasurableSpace β
inst✝⁷ : OpensMeasurableSpace β
inst✝⁶ : TopologicalSpace γ
inst✝⁵ : MeasurableSpace γ
inst✝⁴ : BorelSpace γ
inst✝³ : TopologicalSpace γ₂
inst✝² : MeasurableSpace γ₂
inst✝¹ : BorelSpace γ₂
inst✝ : MeasurableSpace δ
h : SecondCountableTopologyEither α β
s : Set (α × β)
hs : IsOpen s
hβ : SecondCountableTopology β
F : Set β → Set α := fun a => {y | ∃ b, IsOpen b ∧ y ∈ b ∧ b ×ˢ a ⊆ s}
A : ∀ (a : Set β), IsOpen (F a)
y1 : α
y2 : β
hy : (y1, y2) ∈ ⋃ a ∈ countableBasis β, F a ×ˢ a
⊢ (y1, y2) ∈ s

Next tactic:
simp only [mem_iUnion, mem_prod, mem_setOf_eq, exists_and_left, exists_prop] at hy
instance nhdsWithin_Icc_isMeasurablyGenerated : IsMeasurablyGenerated (𝓝[Icc a b] x) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : Preorder α
inst✝ : OrderClosedTopology α
a b x : α
⊢ IsMeasurablyGenerated (𝓝[Icc a b] x)

Next tactic:
rw [← Ici_inter_Iic, nhdsWithin_inter]
instance nhdsWithin_Icc_isMeasurablyGenerated : IsMeasurablyGenerated (𝓝[Icc a b] x) := by
  rw [← Ici_inter_Iic, nhdsWithin_inter]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : Preorder α
inst✝ : OrderClosedTopology α
a b x : α
⊢ IsMeasurablyGenerated (𝓝[Ici a] x ⊓ 𝓝[Iic b] x)

Next tactic:
infer_instance
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
⊢ MeasurableSet s

Next tactic:
let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u✝ : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
u : Set α := ⋃ x ∈ s, ⋃ y ∈ s, Ioo x y
⊢ MeasurableSet s

Next tactic:
have huopen : IsOpen u := isOpen_biUnion fun _ _ => isOpen_biUnion fun _ _ => isOpen_Ioo
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
  have huopen : IsOpen u := isOpen_biUnion fun _ _ => isOpen_biUnion fun _ _ => isOpen_Ioo
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u✝ : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
u : Set α := ⋃ x ∈ s, ⋃ y ∈ s, Ioo x y
huopen : IsOpen u
⊢ MeasurableSet s

Next tactic:
have humeas : MeasurableSet u := huopen.measurableSet
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
  have huopen : IsOpen u := isOpen_biUnion fun _ _ => isOpen_biUnion fun _ _ => isOpen_Ioo
  have humeas : MeasurableSet u := huopen.measurableSet
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u✝ : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
u : Set α := ⋃ x ∈ s, ⋃ y ∈ s, Ioo x y
huopen : IsOpen u
humeas : MeasurableSet u
⊢ MeasurableSet s

Next tactic:
have hfinite : (s \ u).Finite := s.finite_diff_iUnion_Ioo
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
  have huopen : IsOpen u := isOpen_biUnion fun _ _ => isOpen_biUnion fun _ _ => isOpen_Ioo
  have humeas : MeasurableSet u := huopen.measurableSet
  have hfinite : (s \ u).Finite := s.finite_diff_iUnion_Ioo
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u✝ : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
u : Set α := ⋃ x ∈ s, ⋃ y ∈ s, Ioo x y
huopen : IsOpen u
humeas : MeasurableSet u
hfinite : Set.Finite (s \ u)
⊢ MeasurableSet s

Next tactic:
have : u ⊆ s := iUnion₂_subset fun x hx => iUnion₂_subset fun y hy =>
    Ioo_subset_Icc_self.trans (h.out hx hy)
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
  have huopen : IsOpen u := isOpen_biUnion fun _ _ => isOpen_biUnion fun _ _ => isOpen_Ioo
  have humeas : MeasurableSet u := huopen.measurableSet
  have hfinite : (s \ u).Finite := s.finite_diff_iUnion_Ioo
  have : u ⊆ s := iUnion₂_subset fun x hx => iUnion₂_subset fun y hy =>
    Ioo_subset_Icc_self.trans (h.out hx hy)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u✝ : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
u : Set α := ⋃ x ∈ s, ⋃ y ∈ s, Ioo x y
huopen : IsOpen u
humeas : MeasurableSet u
hfinite : Set.Finite (s \ u)
this : u ⊆ s
⊢ MeasurableSet s

Next tactic:
rw [← union_diff_cancel this]
theorem Set.OrdConnected.measurableSet (h : OrdConnected s) : MeasurableSet s := by
  let u := ⋃ (x ∈ s) (y ∈ s), Ioo x y
  have huopen : IsOpen u := isOpen_biUnion fun _ _ => isOpen_biUnion fun _ _ => isOpen_Ioo
  have humeas : MeasurableSet u := huopen.measurableSet
  have hfinite : (s \ u).Finite := s.finite_diff_iUnion_Ioo
  have : u ⊆ s := iUnion₂_subset fun x hx => iUnion₂_subset fun y hy =>
    Ioo_subset_Icc_self.trans (h.out hx hy)
  rw [← union_diff_cancel this]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s t u✝ : Set α
inst✝¹⁶ : TopologicalSpace α
inst✝¹⁵ : MeasurableSpace α
inst✝¹⁴ : OpensMeasurableSpace α
inst✝¹³ : TopologicalSpace β
inst✝¹² : MeasurableSpace β
inst✝¹¹ : OpensMeasurableSpace β
inst✝¹⁰ : TopologicalSpace γ
inst✝⁹ : MeasurableSpace γ
inst✝⁸ : BorelSpace γ
inst✝⁷ : TopologicalSpace γ₂
inst✝⁶ : MeasurableSpace γ₂
inst✝⁵ : BorelSpace γ₂
inst✝⁴ : MeasurableSpace δ
α' : Type u_6
inst✝³ : TopologicalSpace α'
inst✝² : MeasurableSpace α'
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
a b x : α
h : OrdConnected s
u : Set α := ⋃ x ∈ s, ⋃ y ∈ s, Ioo x y
huopen : IsOpen u
humeas : MeasurableSet u
hfinite : Set.Finite (s \ u)
this : u ⊆ s
⊢ MeasurableSet (u ∪ s \ u)

Next tactic:
exact humeas.union hfinite.measurableSet
theorem generateFrom_Ico_mem_le_borel {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderClosedTopology α] (s t : Set α) :
    MeasurableSpace.generateFrom { S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S }
      ≤ borel α := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t✝ u : Set α✝
inst✝¹⁹ : TopologicalSpace α✝
inst✝¹⁸ : MeasurableSpace α✝
inst✝¹⁷ : OpensMeasurableSpace α✝
inst✝¹⁶ : TopologicalSpace β
inst✝¹⁵ : MeasurableSpace β
inst✝¹⁴ : OpensMeasurableSpace β
inst✝¹³ : TopologicalSpace γ
inst✝¹² : MeasurableSpace γ
inst✝¹¹ : BorelSpace γ
inst✝¹⁰ : TopologicalSpace γ₂
inst✝⁹ : MeasurableSpace γ₂
inst✝⁸ : BorelSpace γ₂
inst✝⁷ : MeasurableSpace δ
α' : Type u_6
inst✝⁶ : TopologicalSpace α'
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : LinearOrder α✝
inst✝³ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
s t : Set α
⊢ MeasurableSpace.generateFrom {S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S} ≤ borel α

Next tactic:
apply generateFrom_le
theorem generateFrom_Ico_mem_le_borel {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderClosedTopology α] (s t : Set α) :
    MeasurableSpace.generateFrom { S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S }
      ≤ borel α := by
  apply generateFrom_le
  

Proof state:
case h
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t✝ u : Set α✝
inst✝¹⁹ : TopologicalSpace α✝
inst✝¹⁸ : MeasurableSpace α✝
inst✝¹⁷ : OpensMeasurableSpace α✝
inst✝¹⁶ : TopologicalSpace β
inst✝¹⁵ : MeasurableSpace β
inst✝¹⁴ : OpensMeasurableSpace β
inst✝¹³ : TopologicalSpace γ
inst✝¹² : MeasurableSpace γ
inst✝¹¹ : BorelSpace γ
inst✝¹⁰ : TopologicalSpace γ₂
inst✝⁹ : MeasurableSpace γ₂
inst✝⁸ : BorelSpace γ₂
inst✝⁷ : MeasurableSpace δ
α' : Type u_6
inst✝⁶ : TopologicalSpace α'
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : LinearOrder α✝
inst✝³ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
s t : Set α
⊢ ∀ t_1 ∈ {S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S}, MeasurableSet t_1

Next tactic:
borelize α
theorem generateFrom_Ico_mem_le_borel {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderClosedTopology α] (s t : Set α) :
    MeasurableSpace.generateFrom { S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S }
      ≤ borel α := by
  apply generateFrom_le
  borelize α
  

Proof state:
case h
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t✝ u : Set α✝
inst✝¹⁹ : TopologicalSpace α✝
inst✝¹⁸ : MeasurableSpace α✝
inst✝¹⁷ : OpensMeasurableSpace α✝
inst✝¹⁶ : TopologicalSpace β
inst✝¹⁵ : MeasurableSpace β
inst✝¹⁴ : OpensMeasurableSpace β
inst✝¹³ : TopologicalSpace γ
inst✝¹² : MeasurableSpace γ
inst✝¹¹ : BorelSpace γ
inst✝¹⁰ : TopologicalSpace γ₂
inst✝⁹ : MeasurableSpace γ₂
inst✝⁸ : BorelSpace γ₂
inst✝⁷ : MeasurableSpace δ
α' : Type u_6
inst✝⁶ : TopologicalSpace α'
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : LinearOrder α✝
inst✝³ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
s t : Set α
this✝¹ : MeasurableSpace α := borel α
this✝ : BorelSpace α
⊢ ∀ t_1 ∈ {S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S}, MeasurableSet t_1

Next tactic:
rintro _ ⟨a, -, b, -, -, rfl⟩
theorem generateFrom_Ico_mem_le_borel {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderClosedTopology α] (s t : Set α) :
    MeasurableSpace.generateFrom { S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S }
      ≤ borel α := by
  apply generateFrom_le
  borelize α
  rintro _ ⟨a, -, b, -, -, rfl⟩
  

Proof state:
case h.intro.intro.intro.intro.intro
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t✝ u : Set α✝
inst✝¹⁹ : TopologicalSpace α✝
inst✝¹⁸ : MeasurableSpace α✝
inst✝¹⁷ : OpensMeasurableSpace α✝
inst✝¹⁶ : TopologicalSpace β
inst✝¹⁵ : MeasurableSpace β
inst✝¹⁴ : OpensMeasurableSpace β
inst✝¹³ : TopologicalSpace γ
inst✝¹² : MeasurableSpace γ
inst✝¹¹ : BorelSpace γ
inst✝¹⁰ : TopologicalSpace γ₂
inst✝⁹ : MeasurableSpace γ₂
inst✝⁸ : BorelSpace γ₂
inst✝⁷ : MeasurableSpace δ
α' : Type u_6
inst✝⁶ : TopologicalSpace α'
inst✝⁵ : MeasurableSpace α'
inst✝⁴ : LinearOrder α✝
inst✝³ : OrderClosedTopology α✝
a✝ b✝ x : α✝
α : Type u_7
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : OrderClosedTopology α
s t : Set α
this✝¹ : MeasurableSpace α := borel α
this✝ : BorelSpace α
a b : α
⊢ MeasurableSet (Ico a b)

Next tactic:
exact measurableSet_Ico
theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] {s : Set α} (hd : Dense s)
    (hbot : ∀ x, IsBot x → x ∈ s) (hIoo : ∀ x y : α, x < y → Ioo x y = ∅ → y ∈ s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t u : Set α✝
inst✝²⁰ : TopologicalSpace α✝
inst✝¹⁹ : MeasurableSpace α✝
inst✝¹⁸ : OpensMeasurableSpace α✝
inst✝¹⁷ : TopologicalSpace β
inst✝¹⁶ : MeasurableSpace β
inst✝¹⁵ : OpensMeasurableSpace β
inst✝¹⁴ : TopologicalSpace γ
inst✝¹³ : MeasurableSpace γ
inst✝¹² : BorelSpace γ
inst✝¹¹ : TopologicalSpace γ₂
inst✝¹⁰ : MeasurableSpace γ₂
inst✝⁹ : BorelSpace γ₂
inst✝⁸ : MeasurableSpace δ
α' : Type u_6
inst✝⁷ : TopologicalSpace α'
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : LinearOrder α✝
inst✝⁴ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : OrderTopology α
inst✝ : SecondCountableTopology α
s : Set α
hd : Dense s
hbot : ∀ (x : α), IsBot x → x ∈ s
hIoo : ∀ (x y : α), x < y → Ioo x y = ∅ → y ∈ s
⊢ borel α = MeasurableSpace.generateFrom {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S}

Next tactic:
set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }
theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] {s : Set α} (hd : Dense s)
    (hbot : ∀ x, IsBot x → x ∈ s) (hIoo : ∀ x y : α, x < y → Ioo x y = ∅ → y ∈ s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } := by
  set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t u : Set α✝
inst✝²⁰ : TopologicalSpace α✝
inst✝¹⁹ : MeasurableSpace α✝
inst✝¹⁸ : OpensMeasurableSpace α✝
inst✝¹⁷ : TopologicalSpace β
inst✝¹⁶ : MeasurableSpace β
inst✝¹⁵ : OpensMeasurableSpace β
inst✝¹⁴ : TopologicalSpace γ
inst✝¹³ : MeasurableSpace γ
inst✝¹² : BorelSpace γ
inst✝¹¹ : TopologicalSpace γ₂
inst✝¹⁰ : MeasurableSpace γ₂
inst✝⁹ : BorelSpace γ₂
inst✝⁸ : MeasurableSpace δ
α' : Type u_6
inst✝⁷ : TopologicalSpace α'
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : LinearOrder α✝
inst✝⁴ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : OrderTopology α
inst✝ : SecondCountableTopology α
s : Set α
hd : Dense s
hbot : ∀ (x : α), IsBot x → x ∈ s
hIoo : ∀ (x y : α), x < y → Ioo x y = ∅ → y ∈ s
S : Set (Set α) := {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S}
⊢ borel α = MeasurableSpace.generateFrom S

Next tactic:
refine' le_antisymm _ (generateFrom_Ico_mem_le_borel _ _)
theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] {s : Set α} (hd : Dense s)
    (hbot : ∀ x, IsBot x → x ∈ s) (hIoo : ∀ x y : α, x < y → Ioo x y = ∅ → y ∈ s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } := by
  set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }
  refine' le_antisymm _ (generateFrom_Ico_mem_le_borel _ _)
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t u : Set α✝
inst✝²⁰ : TopologicalSpace α✝
inst✝¹⁹ : MeasurableSpace α✝
inst✝¹⁸ : OpensMeasurableSpace α✝
inst✝¹⁷ : TopologicalSpace β
inst✝¹⁶ : MeasurableSpace β
inst✝¹⁵ : OpensMeasurableSpace β
inst✝¹⁴ : TopologicalSpace γ
inst✝¹³ : MeasurableSpace γ
inst✝¹² : BorelSpace γ
inst✝¹¹ : TopologicalSpace γ₂
inst✝¹⁰ : MeasurableSpace γ₂
inst✝⁹ : BorelSpace γ₂
inst✝⁸ : MeasurableSpace δ
α' : Type u_6
inst✝⁷ : TopologicalSpace α'
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : LinearOrder α✝
inst✝⁴ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : OrderTopology α
inst✝ : SecondCountableTopology α
s : Set α
hd : Dense s
hbot : ∀ (x : α), IsBot x → x ∈ s
hIoo : ∀ (x y : α), x < y → Ioo x y = ∅ → y ∈ s
S : Set (Set α) := {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S}
⊢ borel α ≤ MeasurableSpace.generateFrom S

Next tactic:
letI : MeasurableSpace α := generateFrom S
theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] {s : Set α} (hd : Dense s)
    (hbot : ∀ x, IsBot x → x ∈ s) (hIoo : ∀ x y : α, x < y → Ioo x y = ∅ → y ∈ s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } := by
  set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }
  refine' le_antisymm _ (generateFrom_Ico_mem_le_borel _ _)
  letI : MeasurableSpace α := generateFrom S
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t u : Set α✝
inst✝²⁰ : TopologicalSpace α✝
inst✝¹⁹ : MeasurableSpace α✝
inst✝¹⁸ : OpensMeasurableSpace α✝
inst✝¹⁷ : TopologicalSpace β
inst✝¹⁶ : MeasurableSpace β
inst✝¹⁵ : OpensMeasurableSpace β
inst✝¹⁴ : TopologicalSpace γ
inst✝¹³ : MeasurableSpace γ
inst✝¹² : BorelSpace γ
inst✝¹¹ : TopologicalSpace γ₂
inst✝¹⁰ : MeasurableSpace γ₂
inst✝⁹ : BorelSpace γ₂
inst✝⁸ : MeasurableSpace δ
α' : Type u_6
inst✝⁷ : TopologicalSpace α'
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : LinearOrder α✝
inst✝⁴ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : OrderTopology α
inst✝ : SecondCountableTopology α
s : Set α
hd : Dense s
hbot : ∀ (x : α), IsBot x → x ∈ s
hIoo : ∀ (x y : α), x < y → Ioo x y = ∅ → y ∈ s
S : Set (Set α) := {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S}
this : MeasurableSpace α := MeasurableSpace.generateFrom S
⊢ borel α ≤ MeasurableSpace.generateFrom S

Next tactic:
rw [borel_eq_generateFrom_Iio]
theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] {s : Set α} (hd : Dense s)
    (hbot : ∀ x, IsBot x → x ∈ s) (hIoo : ∀ x y : α, x < y → Ioo x y = ∅ → y ∈ s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } := by
  set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }
  refine' le_antisymm _ (generateFrom_Ico_mem_le_borel _ _)
  letI : MeasurableSpace α := generateFrom S
  rw [borel_eq_generateFrom_Iio]
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
γ₂ : Type u_4
δ : Type u_5
ι : Sort y
s✝ t u : Set α✝
inst✝²⁰ : TopologicalSpace α✝
inst✝¹⁹ : MeasurableSpace α✝
inst✝¹⁸ : OpensMeasurableSpace α✝
inst✝¹⁷ : TopologicalSpace β
inst✝¹⁶ : MeasurableSpace β
inst✝¹⁵ : OpensMeasurableSpace β
inst✝¹⁴ : TopologicalSpace γ
inst✝¹³ : MeasurableSpace γ
inst✝¹² : BorelSpace γ
inst✝¹¹ : TopologicalSpace γ₂
inst✝¹⁰ : MeasurableSpace γ₂
inst✝⁹ : BorelSpace γ₂
inst✝⁸ : MeasurableSpace δ
α' : Type u_6
inst✝⁷ : TopologicalSpace α'
inst✝⁶ : MeasurableSpace α'
inst✝⁵ : LinearOrder α✝
inst✝⁴ : OrderClosedTopology α✝
a b x : α✝
α : Type u_7
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : OrderTopology α
inst✝ : SecondCountableTopology α
s : Set α
hd : Dense s
hbot : ∀ (x : α), IsBot x → x ∈ s
hIoo : ∀ (x y : α), x < y → Ioo x y = ∅ → y ∈ s
S : Set (Set α) := {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S}
this : MeasurableSpace α := MeasurableSpace.generateFrom S
⊢ MeasurableSpace.generateFrom (range Iio) ≤ MeasurableSpace.generateFrom S

Next tactic:
refine' generateFrom_le (forall_range_iff.2 fun a => _)