l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem Icc_diff_Ico_same (h : a ≤ b) : Icc a b \ Ico a b = {b} := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ Icc a b \ Ico a b = {b}

Next tactic:
rw [← Icc_diff_right, diff_diff_cancel_left (singleton_subset_iff.2 <| right_mem_Icc.2 h)]
@[simp]
theorem Icc_diff_Ioc_same (h : a ≤ b) : Icc a b \ Ioc a b = {a} := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ Icc a b \ Ioc a b = {a}

Next tactic:
rw [← Icc_diff_left, diff_diff_cancel_left (singleton_subset_iff.2 <| left_mem_Icc.2 h)]
@[simp]
theorem Icc_diff_Ioo_same (h : a ≤ b) : Icc a b \ Ioo a b = {a, b} := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ Icc a b \ Ioo a b = {a, b}

Next tactic:
rw [← Icc_diff_both, diff_diff_cancel_left]
@[simp]
theorem Icc_diff_Ioo_same (h : a ≤ b) : Icc a b \ Ioo a b = {a, b} := by
  rw [← Icc_diff_both, diff_diff_cancel_left]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ {a, b} ⊆ Icc a b

Next tactic:
simp [insert_subset_iff, h]
@[simp]
theorem Ici_diff_Ioi_same : Ici a \ Ioi a = {a} := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
⊢ Ici a \ Ioi a = {a}

Next tactic:
rw [← Ici_diff_left, diff_diff_cancel_left (singleton_subset_iff.2 left_mem_Ici)]
@[simp]
theorem Iic_diff_Iio_same : Iic a \ Iio a = {a} := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
⊢ Iic a \ Iio a = {a}

Next tactic:
rw [← Iic_diff_right, diff_diff_cancel_left (singleton_subset_iff.2 right_mem_Iic)]
theorem Ioi_union_left : Ioi a ∪ {a} = Ici a :=
  ext fun x => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c x : α
⊢ x ∈ Ioi a ∪ {a} ↔ x ∈ Ici a

Next tactic:
simp [eq_comm, le_iff_eq_or_lt]
theorem Ioo_union_left (hab : a < b) : Ioo a b ∪ {a} = Ico a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
hab : a < b
⊢ Ioo a b ∪ {a} = Ico a b

Next tactic:
rw [← Ico_diff_left, diff_union_self,
    union_eq_self_of_subset_right (singleton_subset_iff.2 <| left_mem_Ico.2 hab)]
theorem Ioo_union_right (hab : a < b) : Ioo a b ∪ {b} = Ioc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
hab : a < b
⊢ Ioo a b ∪ {b} = Ioc a b

Next tactic:
simpa only [dual_Ioo, dual_Ico] using Ioo_union_left hab.dual
theorem Ioo_union_both (h : a ≤ b) : Ioo a b ∪ {a, b} = Icc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ Ioo a b ∪ {a, b} = Icc a b

Next tactic:
have : (Icc a b \ {a, b}) ∪ {a, b} = Icc a b := diff_union_of_subset fun
    | x, .inl rfl => left_mem_Icc.mpr h
    | x, .inr rfl => right_mem_Icc.mpr h
theorem Ioo_union_both (h : a ≤ b) : Ioo a b ∪ {a, b} = Icc a b := by
  have : (Icc a b \ {a, b}) ∪ {a, b} = Icc a b := diff_union_of_subset fun
    | x, .inl rfl => left_mem_Icc.mpr h
    | x, .inr rfl => right_mem_Icc.mpr h
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
this : Icc a b \ {a, b} ∪ {a, b} = Icc a b
⊢ Ioo a b ∪ {a, b} = Icc a b

Next tactic:
rw [← this, Icc_diff_both]
theorem Ioc_union_left (hab : a ≤ b) : Ioc a b ∪ {a} = Icc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
hab : a ≤ b
⊢ Ioc a b ∪ {a} = Icc a b

Next tactic:
rw [← Icc_diff_left, diff_union_self,
    union_eq_self_of_subset_right (singleton_subset_iff.2 <| left_mem_Icc.2 hab)]
theorem Ico_union_right (hab : a ≤ b) : Ico a b ∪ {b} = Icc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
hab : a ≤ b
⊢ Ico a b ∪ {b} = Icc a b

Next tactic:
simpa only [dual_Ioc, dual_Icc] using Ioc_union_left hab.dual
@[simp]
theorem Ico_insert_right (h : a ≤ b) : insert b (Ico a b) = Icc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ insert b (Ico a b) = Icc a b

Next tactic:
rw [insert_eq, union_comm, Ico_union_right h]
@[simp]
theorem Ioc_insert_left (h : a ≤ b) : insert a (Ioc a b) = Icc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ insert a (Ioc a b) = Icc a b

Next tactic:
rw [insert_eq, union_comm, Ioc_union_left h]
@[simp]
theorem Ioo_insert_left (h : a < b) : insert a (Ioo a b) = Ico a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a < b
⊢ insert a (Ioo a b) = Ico a b

Next tactic:
rw [insert_eq, union_comm, Ioo_union_left h]
@[simp]
theorem Ioo_insert_right (h : a < b) : insert b (Ioo a b) = Ioc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
h : a < b
⊢ insert b (Ioo a b) = Ioc a b

Next tactic:
rw [insert_eq, union_comm, Ioo_union_right h]
theorem mem_Ici_Ioi_of_subset_of_subset {s : Set α} (ho : Ioi a ⊆ s) (hc : s ⊆ Ici a) :
    s ∈ ({Ici a, Ioi a} : Set (Set α)) :=
  by_cases
    (fun h : a ∈ s =>
      Or.inl <| Subset.antisymm hc <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioi a ⊆ s
hc : s ⊆ Ici a
h : a ∈ s
⊢ Ici a ⊆ s

Next tactic:
rw [← Ioi_union_left, union_subset_iff]
theorem mem_Ici_Ioi_of_subset_of_subset {s : Set α} (ho : Ioi a ⊆ s) (hc : s ⊆ Ici a) :
    s ∈ ({Ici a, Ioi a} : Set (Set α)) :=
  by_cases
    (fun h : a ∈ s =>
      Or.inl <| Subset.antisymm hc <| by rw [← Ioi_union_left, union_subset_iff]; 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioi a ⊆ s
hc : s ⊆ Ici a
h : a ∈ s
⊢ Ioi a ⊆ s ∧ {a} ⊆ s

Next tactic:
simp [*]
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_left]
        exact subset_diff_singleton hc ha
      · rwa [← Ioc_diff_right, diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inr <| Or.inr <| Subset.antisymm _ ho
      rw [← Ico_diff_left, ← Icc_diff_right]
      apply_rules [subset_diff_singleton]
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
by_cases ha : a ∈ s
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
by_cases hb : b ∈ s
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
by_cases hb : b ∈ s
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
hb : b ∈ s
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
refine' Or.inl (Subset.antisymm hc _)
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
hb : b ∈ s
⊢ Icc a b ⊆ s

Next tactic:
rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
hb : b ∉ s
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
refine' Or.inr <| Or.inl <| Subset.antisymm _ _
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · 

Proof state:
case neg.refine'_1
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
hb : b ∉ s
⊢ s ⊆ Ico a b

Next tactic:
rw [← Icc_diff_right]
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        

Proof state:
case neg.refine'_1
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
hb : b ∉ s
⊢ s ⊆ Icc a b \ {b}

Next tactic:
exact subset_diff_singleton hc hb
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · 

Proof state:
case neg.refine'_2
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∈ s
hb : b ∉ s
⊢ Ico a b ⊆ s

Next tactic:
rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∈ s
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · 

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∈ s
⊢ s ⊆ Ioc a b

Next tactic:
rw [← Icc_diff_left]
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_left]
        

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∈ s
⊢ s ⊆ Icc a b \ {a}

Next tactic:
exact subset_diff_singleton hc ha
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_left]
        exact subset_diff_singleton hc ha
      · 

Proof state:
case pos.refine'_2
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∈ s
⊢ Ioc a b ⊆ s

Next tactic:
rwa [← Ioc_diff_right, diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_left]
        exact subset_diff_singleton hc ha
      · rwa [← Ioc_diff_right, diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∉ s
⊢ s ∈ {Icc a b, Ico a b, Ioc a b, Ioo a b}

Next tactic:
refine' Or.inr <| Or.inr <| Or.inr <| Subset.antisymm _ ho
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_left]
        exact subset_diff_singleton hc ha
      · rwa [← Ioc_diff_right, diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inr <| Or.inr <| Subset.antisymm _ ho
      

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∉ s
⊢ s ⊆ Ioo a b

Next tactic:
rw [← Ico_diff_left, ← Icc_diff_right]
theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α)) := by
  classical
    by_cases ha : a ∈ s <;> by_cases hb : b ∈ s
    · refine' Or.inl (Subset.antisymm hc _)
      rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha, ← Icc_diff_right,
        diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_right]
        exact subset_diff_singleton hc hb
      · rwa [← Ico_diff_left, diff_singleton_subset_iff, insert_eq_of_mem ha] at ho
    · refine' Or.inr <| Or.inr <| Or.inl <| Subset.antisymm _ _
      · rw [← Icc_diff_left]
        exact subset_diff_singleton hc ha
      · rwa [← Ioc_diff_right, diff_singleton_subset_iff, insert_eq_of_mem hb] at ho
    · refine' Or.inr <| Or.inr <| Or.inr <| Subset.antisymm _ ho
      rw [← Ico_diff_left, ← Icc_diff_right]
      

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : PartialOrder α
a b c : α
s : Set α
ho : Ioo a b ⊆ s
hc : s ⊆ Icc a b
ha : a ∉ s
hb : b ∉ s
⊢ s ⊆ (Icc a b \ {b}) \ {a}

Next tactic:
apply_rules [subset_diff_singleton]
@[simp]
theorem Icc_top : Icc a ⊤ = Ici a := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : OrderTop α
a : α
⊢ Icc a ⊤ = Ici a

Next tactic:
simp [← Ici_inter_Iic]
@[simp]
theorem Ioc_top : Ioc a ⊤ = Ioi a := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : OrderTop α
a : α
⊢ Ioc a ⊤ = Ioi a

Next tactic:
simp [← Ioi_inter_Iic]
@[simp]
theorem Icc_bot : Icc ⊥ a = Iic a := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : OrderBot α
a : α
⊢ Icc ⊥ a = Iic a

Next tactic:
simp [← Ici_inter_Iic]
@[simp]
theorem Ico_bot : Ico ⊥ a = Iio a := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Preorder α
inst✝ : OrderBot α
a : α
⊢ Ico ⊥ a = Iio a

Next tactic:
simp [← Ici_inter_Iio]
theorem Icc_bot_top [PartialOrder α] [BoundedOrder α] : Icc (⊥ : α) ⊤ = univ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : PartialOrder α
inst✝ : BoundedOrder α
⊢ Icc ⊥ ⊤ = univ

Next tactic:
simp
@[simp]
theorem Ici_diff_Ici : Ici a \ Ici b = Ico a b := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Ici a \ Ici b = Ico a b

Next tactic:
rw [diff_eq, compl_Ici, Ici_inter_Iio]
@[simp]
theorem Ici_diff_Ioi : Ici a \ Ioi b = Icc a b := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Ici a \ Ioi b = Icc a b

Next tactic:
rw [diff_eq, compl_Ioi, Ici_inter_Iic]
@[simp]
theorem Ioi_diff_Ioi : Ioi a \ Ioi b = Ioc a b := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Ioi a \ Ioi b = Ioc a b

Next tactic:
rw [diff_eq, compl_Ioi, Ioi_inter_Iic]
@[simp]
theorem Ioi_diff_Ici : Ioi a \ Ici b = Ioo a b := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Ioi a \ Ici b = Ioo a b

Next tactic:
rw [diff_eq, compl_Ici, Ioi_inter_Iio]
@[simp]
theorem Iic_diff_Iic : Iic b \ Iic a = Ioc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Iic b \ Iic a = Ioc a b

Next tactic:
rw [diff_eq, compl_Iic, inter_comm, Ioi_inter_Iic]
@[simp]
theorem Iio_diff_Iic : Iio b \ Iic a = Ioo a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Iio b \ Iic a = Ioo a b

Next tactic:
rw [diff_eq, compl_Iic, inter_comm, Ioi_inter_Iio]
@[simp]
theorem Iic_diff_Iio : Iic b \ Iio a = Icc a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Iic b \ Iio a = Icc a b

Next tactic:
rw [diff_eq, compl_Iio, inter_comm, Ici_inter_Iic]
@[simp]
theorem Iio_diff_Iio : Iio b \ Iio a = Ico a b := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
⊢ Iio b \ Iio a = Ico a b

Next tactic:
rw [diff_eq, compl_Iio, inter_comm, Ici_inter_Iio]
theorem Ioc_subset_Ioc_iff (h₁ : a₁ < b₁) : Ioc a₁ b₁ ⊆ Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
h₁ : a₁ < b₁
⊢ Ioc a₁ b₁ ⊆ Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁

Next tactic:
convert @Ico_subset_Ico_iff αᵒᵈ _ b₁ b₂ a₁ a₂ h₁ using 2
theorem Ioc_subset_Ioc_iff (h₁ : a₁ < b₁) : Ioc a₁ b₁ ⊆ Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁ := by
  convert @Ico_subset_Ico_iff αᵒᵈ _ b₁ b₂ a₁ a₂ h₁ using 2 <;> 

Proof state:
case h.e'_1.h.e'_3.h
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
h₁ : a₁ < b₁
e_1✝ : Set α = Set αᵒᵈ
⊢ Ioc a₁ b₁ = Ico b₁ a₁

Next tactic:
exact (@dual_Ico α _ _ _).symm
theorem Ioc_subset_Ioc_iff (h₁ : a₁ < b₁) : Ioc a₁ b₁ ⊆ Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁ := by
  convert @Ico_subset_Ico_iff αᵒᵈ _ b₁ b₂ a₁ a₂ h₁ using 2 <;> 

Proof state:
case h.e'_1.h.e'_4.h
α : Type u_1
β : Type u_2
inst✝ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
h₁ : a₁ < b₁
e_1✝ : Set α = Set αᵒᵈ
⊢ Ioc a₂ b₂ = Ico b₂ a₂

Next tactic:
exact (@dual_Ico α _ _ _).symm
theorem Ioo_subset_Ioo_iff [DenselyOrdered α] (h₁ : a₁ < b₁) :
    Ioo a₁ b₁ ⊆ Ioo a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂ :=
  ⟨fun h => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
inst✝ : DenselyOrdered α
h₁ : a₁ < b₁
h : Ioo a₁ b₁ ⊆ Ioo a₂ b₂
⊢ a₂ ≤ a₁ ∧ b₁ ≤ b₂

Next tactic:
rcases exists_between h₁ with ⟨x, xa, xb⟩
theorem Ioo_subset_Ioo_iff [DenselyOrdered α] (h₁ : a₁ < b₁) :
    Ioo a₁ b₁ ⊆ Ioo a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂ :=
  ⟨fun h => by
    rcases exists_between h₁ with ⟨x, xa, xb⟩
    

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
inst✝ : DenselyOrdered α
h₁ : a₁ < b₁
h : Ioo a₁ b₁ ⊆ Ioo a₂ b₂
x : α
xa : a₁ < x
xb : x < b₁
⊢ a₂ ≤ a₁ ∧ b₁ ≤ b₂

Next tactic:
constructor
theorem Ioo_subset_Ioo_iff [DenselyOrdered α] (h₁ : a₁ < b₁) :
    Ioo a₁ b₁ ⊆ Ioo a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂ :=
  ⟨fun h => by
    rcases exists_between h₁ with ⟨x, xa, xb⟩
    constructor <;> 

Proof state:
case intro.intro.left
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
a a₁ a₂ b b₁ b₂ c d : α
inst✝ : DenselyOrdered α
h₁ : a₁ < b₁
h : Ioo a₁ b₁ ⊆ Ioo a₂ b₂
x : α
xa : a₁ < x
xb : x < b₁
⊢ a₂ ≤ a₁

Next tactic:
refine' le_of_not_lt fun h' => _