Theorem: borel_eq_generateFrom_Iio
File: Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean

tactic: refine' le_antisymm _ (generateFrom_le _)
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
⊢ borel α = MeasurableSpace.generateFrom (range Iio)

tactic: rw [borel_eq_generateFrom_of_subbasis (@OrderTopology.topology_eq_generate_intervals α _ _ _)]
state_before: case refine'_1
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
⊢ borel α ≤ MeasurableSpace.generateFrom (range Iio)

tactic: letI : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
state_before: case refine'_1
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
⊢ MeasurableSpace.generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} ≤ MeasurableSpace.generateFrom (range Iio)

tactic: have H : ∀ a : α, MeasurableSet (Iio a) := fun a => GenerateMeasurable.basic _ ⟨_, rfl⟩
state_before: case refine'_1
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
⊢ MeasurableSpace.generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} ≤ MeasurableSpace.generateFrom (range Iio)

tactic: refine' generateFrom_le _
state_before: case refine'_1
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
⊢ MeasurableSpace.generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} ≤ MeasurableSpace.generateFrom (range Iio)

tactic: rintro _ ⟨a, rfl | rfl⟩ <;> [skip; apply H]
state_before: case refine'_1
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
⊢ ∀ (t : Set α), t ∈ {s | ∃ a, s = Ioi a ∨ s = Iio a} → MeasurableSet t

tactic: by_cases h : ∃ a', ∀ b, a < b ↔ a' ≤ b
state_before: case refine'_1.intro.inl
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
⊢ MeasurableSet (Ioi a)

tactic: rcases h with ⟨a', ha'⟩
state_before: case pos
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ∃ a', ∀ (b : α), a < b ↔ a' ≤ b
⊢ MeasurableSet (Ioi a)

tactic: rw [(_ : Ioi a = Iio a'ᶜ)]
state_before: case pos.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a a' : α
ha' : ∀ (b : α), a < b ↔ a' ≤ b
⊢ MeasurableSet (Ioi a)

tactic: simp [Set.ext_iff, ha']
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a a' : α
ha' : ∀ (b : α), a < b ↔ a' ≤ b
⊢ Ioi a = Iio a'ᶜ

tactic: exact (H _).compl
state_before: case pos.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a a' : α
ha' : ∀ (b : α), a < b ↔ a' ≤ b
⊢ MeasurableSet (Iio a'ᶜ)

tactic: rcases isOpen_iUnion_countable (fun a' : { a' : α // a < a' } => { b | a'.1 < b }) fun a' =>
    isOpen_lt' _ with ⟨v, ⟨hv⟩, vu⟩
state_before: case neg
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
⊢ MeasurableSet (Ioi a)

tactic: simp [Set.ext_iff] at vu
state_before: case neg.intro.intro.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
vu : (⋃ (i : { a' // a < a' }) (_ : i ∈ v), {b | ↑i < b}) = ⋃ (i : { a' // a < a' }), {b | ↑i < b}
hv : Encodable ↑v
⊢ MeasurableSet (Ioi a)

tactic: rw [this]
state_before: case neg.intro.intro.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this✝ : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
this : Ioi a = ⋃ (x : ↑v), Iio ↑↑xᶜ
⊢ MeasurableSet (Ioi a)

tactic: skip
state_before: case neg.intro.intro.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this✝ : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
this : Ioi a = ⋃ (x : ↑v), Iio ↑↑xᶜ
⊢ MeasurableSet (⋃ (x : ↑v), Iio ↑↑xᶜ)

tactic: apply MeasurableSet.iUnion
state_before: case neg.intro.intro.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this✝ : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
this : Ioi a = ⋃ (x : ↑v), Iio ↑↑xᶜ
⊢ MeasurableSet (⋃ (x : ↑v), Iio ↑↑xᶜ)

tactic: exact fun _ => (H _).compl
state_before: case neg.intro.intro.intro.h
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this✝ : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
this : Ioi a = ⋃ (x : ↑v), Iio ↑↑xᶜ
⊢ ∀ (b : ↑v), MeasurableSet (Iio ↑↑bᶜ)

tactic: simp [Set.ext_iff]
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
⊢ Ioi a = ⋃ (x : ↑v), Iio ↑↑xᶜ

tactic: refine' fun x => ⟨fun ax => _, fun ⟨a', ⟨h, _⟩, ax⟩ => lt_of_lt_of_le h ax⟩
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
⊢ ∀ (x : α), a < x ↔ ∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 ≤ x

tactic: rcases (vu x).2 (by
  refine' not_imp_comm.1 (fun h => _) h
  exact ⟨x, fun b =>
    ⟨fun ab => le_of_not_lt fun h' => h ⟨b, ab, h'⟩, lt_of_lt_of_le ax⟩⟩) with ⟨a', h₁, h₂⟩
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
x : α
ax : a < x
⊢ ∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 ≤ x

tactic: refine' not_imp_comm.1 (fun h => _) h
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
x : α
ax : a < x
⊢ ∃ a_1, a < a_1 ∧ a_1 < x

tactic: exact ⟨x, fun b =>
  ⟨fun ab => le_of_not_lt fun h' => h ⟨b, ab, h'⟩, lt_of_lt_of_le ax⟩⟩
state_before: α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h✝ : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
x : α
ax : a < x
h : ¬∃ a_1, a < a_1 ∧ a_1 < x
⊢ ∃ a', ∀ (b : α), a < b ↔ a' ≤ b

tactic: exact ⟨a', h₁, le_of_lt h₂⟩
state_before: case intro.intro
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
this : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio)
H : ∀ (a : α), MeasurableSet (Iio a)
a : α
h : ¬∃ a', ∀ (b : α), a < b ↔ a' ≤ b
v : Set { a' // a < a' }
hv : Encodable ↑v
vu : ∀ (x : α), (∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 < x) ↔ ∃ a_1, a < a_1 ∧ a_1 < x
x : α
ax : a < x
a' : α
h₁ : ∃ x, { val := a', property := (_ : a < a') } ∈ v
h₂ : a' < x
⊢ ∃ a_1, (∃ x, { val := a_1, property := (_ : a < a_1) } ∈ v) ∧ a_1 ≤ x

tactic: rw [forall_range_iff]
state_before: case refine'_2
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
⊢ ∀ (t : Set α), t ∈ range Iio → MeasurableSet t

tactic: intro a
state_before: case refine'_2
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
⊢ ∀ (i : α), MeasurableSet (Iio i)

tactic: exact GenerateMeasurable.basic _ isOpen_Iio
state_before: case refine'_2
α : Type u_1
β : Type ?u.82061
γ : Type ?u.82064
γ₂ : Type ?u.82067
δ : Type ?u.82070
ι : Sort y
s t u : Set α
inst✝³ : TopologicalSpace α
inst✝² : SecondCountableTopology α
inst✝¹ : LinearOrder α
inst✝ : OrderTopology α
a : α
⊢ MeasurableSet (Iio a)