l3lab/ntp-mathlib huggingface dataset:
instance : IsTrans (Set α) (· ⊆ ·) :=
  show IsTrans (Set α) (· ≤ ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ IsTrans (Set α) fun x x_1 => x ≤ x_1

Next tactic:
infer_instance
instance : Trans ((· ⊆ ·) : Set α → Set α → Prop) (· ⊆ ·) (· ⊆ ·) :=
  show Trans (· ≤ ·) (· ≤ ·) (· ≤ ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Trans (fun x x_1 => x ≤ x_1) (fun x x_1 => x ≤ x_1) fun x x_1 => x ≤ x_1

Next tactic:
infer_instance
instance : IsAntisymm (Set α) (· ⊆ ·) :=
  show IsAntisymm (Set α) (· ≤ ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ IsAntisymm (Set α) fun x x_1 => x ≤ x_1

Next tactic:
infer_instance
instance : IsIrrefl (Set α) (· ⊂ ·) :=
  show IsIrrefl (Set α) (· < ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ IsIrrefl (Set α) fun x x_1 => x < x_1

Next tactic:
infer_instance
instance : IsTrans (Set α) (· ⊂ ·) :=
  show IsTrans (Set α) (· < ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ IsTrans (Set α) fun x x_1 => x < x_1

Next tactic:
infer_instance
instance : Trans ((· ⊂ ·) : Set α → Set α → Prop) (· ⊂ ·) (· ⊂ ·) :=
  show Trans (· < ·) (· < ·) (· < ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Trans (fun x x_1 => x < x_1) (fun x x_1 => x < x_1) fun x x_1 => x < x_1

Next tactic:
infer_instance
instance : Trans ((· ⊂ ·) : Set α → Set α → Prop) (· ⊆ ·) (· ⊂ ·) :=
  show Trans (· < ·) (· ≤ ·) (· < ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Trans (fun x x_1 => x < x_1) (fun x x_1 => x ≤ x_1) fun x x_1 => x < x_1

Next tactic:
infer_instance
instance : Trans ((· ⊆ ·) : Set α → Set α → Prop) (· ⊂ ·) (· ⊂ ·) :=
  show Trans (· ≤ ·) (· < ·) (· < ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Trans (fun x x_1 => x ≤ x_1) (fun x x_1 => x < x_1) fun x x_1 => x < x_1

Next tactic:
infer_instance
instance : IsAsymm (Set α) (· ⊂ ·) :=
  show IsAsymm (Set α) (· < ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ IsAsymm (Set α) fun x x_1 => x < x_1

Next tactic:
infer_instance
theorem not_subset : ¬s ⊆ t ↔ ∃ a ∈ s, a ∉ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ ¬s ⊆ t ↔ ∃ a ∈ s, a ∉ t

Next tactic:
simp only [subset_def, not_forall, exists_prop]
theorem inter_nonempty_iff_exists_left : (s ∩ t).Nonempty ↔ ∃ x ∈ s, x ∈ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Set.Nonempty (s ∩ t) ↔ ∃ x ∈ s, x ∈ t

Next tactic:
simp_rw [inter_nonempty]
theorem inter_nonempty_iff_exists_right : (s ∩ t).Nonempty ↔ ∃ x ∈ t, x ∈ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Set.Nonempty (s ∩ t) ↔ ∃ x ∈ t, x ∈ s

Next tactic:
simp_rw [inter_nonempty, and_comm]
/-- See also `Set.nonempty_iff_ne_empty`. -/
theorem not_nonempty_iff_eq_empty {s : Set α} : ¬s.Nonempty ↔ s = ∅ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ ¬Set.Nonempty s ↔ s = ∅

Next tactic:
simp only [Set.Nonempty, not_exists, eq_empty_iff_forall_not_mem]
/-- See also `nonempty_iff_ne_empty'`. -/
theorem not_nonempty_iff_eq_empty' : ¬Nonempty s ↔ s = ∅ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ ¬Nonempty ↑s ↔ s = ∅

Next tactic:
rw [nonempty_subtype, not_exists, eq_empty_iff_forall_not_mem]
theorem isEmpty_coe_sort {s : Set α} : IsEmpty (↥s) ↔ s = ∅ :=
  not_iff_not.1 <| by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ ¬IsEmpty ↑s ↔ ¬s = ∅

Next tactic:
simpa using nonempty_iff_ne_empty
theorem Nonempty.eq_univ [Subsingleton α] : s.Nonempty → s = univ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Subsingleton α
⊢ Set.Nonempty s → s = univ

Next tactic:
rintro ⟨x, hx⟩
theorem Nonempty.eq_univ [Subsingleton α] : s.Nonempty → s = univ := by
  rintro ⟨x, hx⟩
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Subsingleton α
x : α
hx : x ∈ s
⊢ s = univ

Next tactic:
refine' eq_univ_of_forall fun y => by rwa [Subsingleton.elim y x]
theorem Nonempty.eq_univ [Subsingleton α] : s.Nonempty → s = univ := by
  rintro ⟨x, hx⟩
  refine' eq_univ_of_forall fun y => by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Subsingleton α
x : α
hx : x ∈ s
y : α
⊢ y ∈ s

Next tactic:
rwa [Subsingleton.elim y x]
theorem ne_univ_iff_exists_not_mem {α : Type*} (s : Set α) : s ≠ univ ↔ ∃ a, a ∉ s := by
  

Proof state:
α✝ : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α✝
s✝ s₁ s₂ t t₁ t₂ u : Set α✝
α : Type u_1
s : Set α
⊢ s ≠ univ ↔ ∃ a, a ∉ s

Next tactic:
rw [← not_forall, ← eq_univ_iff_forall]
theorem not_subset_iff_exists_mem_not_mem {α : Type*} {s t : Set α} :
    ¬s ⊆ t ↔ ∃ x, x ∈ s ∧ x ∉ t := by 

Proof state:
α✝ : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α✝
s✝ s₁ s₂ t✝ t₁ t₂ u : Set α✝
α : Type u_1
s t : Set α
⊢ ¬s ⊆ t ↔ ∃ x ∈ s, x ∉ t

Next tactic:
simp [subset_def]
@[simp]
theorem union_empty_iff {s t : Set α} : s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅

Next tactic:
simp only [← subset_empty_iff]
@[simp]
theorem union_empty_iff {s t : Set α} : s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅ := by
  simp only [← subset_empty_iff]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ s ∪ t ⊆ ∅ ↔ s ⊆ ∅ ∧ t ⊆ ∅

Next tactic:
exact union_subset_iff
theorem insert_subset_iff : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t

Next tactic:
simp only [subset_def, mem_insert_iff, or_imp, forall_and, forall_eq]
@[simp] theorem insert_subset_insert_iff (ha : a ∉ s) : insert a s ⊆ insert a t ↔ s ⊆ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
ha : a ∉ s
⊢ insert a s ⊆ insert a t ↔ s ⊆ t

Next tactic:
refine' ⟨fun h x hx => _, insert_subset_insert⟩
@[simp] theorem insert_subset_insert_iff (ha : a ∉ s) : insert a s ⊆ insert a t ↔ s ⊆ t := by
  refine' ⟨fun h x hx => _, insert_subset_insert⟩
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
ha : a ∉ s
h : insert a s ⊆ insert a t
x : α
hx : x ∈ s
⊢ x ∈ t

Next tactic:
rcases h (subset_insert _ _ hx) with (rfl | hxt)
@[simp] theorem insert_subset_insert_iff (ha : a ∉ s) : insert a s ⊆ insert a t ↔ s ⊆ t := by
  refine' ⟨fun h x hx => _, insert_subset_insert⟩
  rcases h (subset_insert _ _ hx) with (rfl | hxt)
  

Proof state:
case inl
α : Type u
β : Type v
γ : Type w
ι : Sort x
b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
hx : x ∈ s
ha : x ∉ s
h : insert x s ⊆ insert x t
⊢ x ∈ t
case inr
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
ha : a ∉ s
h : insert a s ⊆ insert a t
x : α
hx : x ∈ s
hxt : x ∈ t
⊢ x ∈ t

Next tactic:
exacts [(ha hx).elim, hxt]
theorem ssubset_iff_insert {s t : Set α} : s ⊂ t ↔ ∃ a ∉ s, insert a s ⊆ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ s ⊂ t ↔ ∃ a ∉ s, insert a s ⊆ t

Next tactic:
simp only [insert_subset_iff, exists_and_right, ssubset_def, not_subset]
theorem ssubset_iff_insert {s t : Set α} : s ⊂ t ↔ ∃ a ∉ s, insert a s ⊆ t := by
  simp only [insert_subset_iff, exists_and_right, ssubset_def, not_subset]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ (s ⊆ t ∧ ∃ a ∈ t, a ∉ s) ↔ ∃ a ∉ s, a ∈ t ∧ s ⊆ t

Next tactic:
aesop
theorem bex_insert_iff {P : α → Prop} {a : α} {s : Set α} :
    (∃ x ∈ insert a s, P x) ↔ (P a ∨ ∃ x ∈ s, P x) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a✝ b : α
s✝ s₁ s₂ t t₁ t₂ u : Set α
P : α → Prop
a : α
s : Set α
⊢ (∃ x ∈ insert a s, P x) ↔ P a ∨ ∃ x ∈ s, P x

Next tactic:
simp [mem_insert_iff, or_and_right, exists_and_left, exists_or]
instance : IsLawfulSingleton α (Set α) :=
  ⟨fun x => Set.ext <| fun a => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a✝ b : α
s s₁ s₂ t t₁ t₂ u : Set α
x a : α
⊢ a ∈ insert x ∅ ↔ a ∈ {x}

Next tactic:
simp only [mem_empty_iff_false, mem_insert_iff, or_false]
instance : IsLawfulSingleton α (Set α) :=
  ⟨fun x => Set.ext <| fun a => by
    simp only [mem_empty_iff_false, mem_insert_iff, or_false]
    

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a✝ b : α
s s₁ s₂ t t₁ t₂ u : Set α
x a : α
⊢ a = x ↔ a ∈ {x}

Next tactic:
exact Iff.rfl
theorem singleton_subset_singleton : ({a} : Set α) ⊆ {b} ↔ a = b := by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ {a} ⊆ {b} ↔ a = b

Next tactic:
simp
@[simp]
theorem singleton_inter_nonempty : ({a} ∩ s).Nonempty ↔ a ∈ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Set.Nonempty ({a} ∩ s) ↔ a ∈ s

Next tactic:
simp only [Set.Nonempty, mem_inter_iff, mem_singleton_iff, exists_eq_left]
@[simp]
theorem inter_singleton_nonempty : (s ∩ {a}).Nonempty ↔ a ∈ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Set.Nonempty (s ∩ {a}) ↔ a ∈ s

Next tactic:
rw [inter_comm, singleton_inter_nonempty]
@[simp]
theorem inter_singleton_eq_empty : s ∩ {a} = ∅ ↔ a ∉ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ s ∩ {a} = ∅ ↔ a ∉ s

Next tactic:
rw [inter_comm, singleton_inter_eq_empty]
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y z w : α
⊢ {x, y} = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z

Next tactic:
simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y z w : α
⊢ ((x = z ∨ x = w) ∧ (y = z ∨ y = w)) ∧ (z = x ∨ z = y) ∧ (w = x ∨ w = y) ↔ x = z ∧ y = w ∨ x = w ∧ y = z

Next tactic:
constructor
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · 

Proof state:
case mp
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y z w : α
⊢ ((x = z ∨ x = w) ∧ (y = z ∨ y = w)) ∧ (z = x ∨ z = y) ∧ (w = x ∨ w = y) → x = z ∧ y = w ∨ x = w ∧ y = z

Next tactic:
rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> 

Proof state:
case mp.intro.intro.inl.inl.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
y w : α
h₁ : y = y ∨ y = y
h₂ : w = y ∨ w = y
⊢ y = y ∧ y = w ∨ y = w ∧ y = y

Next tactic:
simp [h₁, h₂] at *
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> 

Proof state:
case mp.intro.intro.inl.inr.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y : α
h₁ : x = x ∨ x = y
h₂ : y = x ∨ y = y
⊢ x = x ∧ y = y ∨ x = y ∧ y = x

Next tactic:
simp [h₁, h₂] at *
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> 

Proof state:
case mp.intro.intro.inr.inl.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y : α
h₁ : y = x ∨ y = y
h₂ : x = x ∨ x = y
⊢ x = y ∧ y = x ∨ x = x ∧ y = y

Next tactic:
simp [h₁, h₂] at *
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> 

Proof state:
case mp.intro.intro.inr.inr.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
y z : α
h₁ : z = y ∨ z = y
h₂ : y = y ∨ y = y
⊢ y = z ∧ y = y ∨ y = y ∧ y = z

Next tactic:
simp [h₁, h₂] at *
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> simp [h₁, h₂] at * <;> 

Proof state:
case mp.intro.intro.inl.inl.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
y w : α
h₁ : True
h₂ : w = y
⊢ y = w

Next tactic:
simp [h₁, h₂]
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> simp [h₁, h₂] at * <;> 

Proof state:
case mp.intro.intro.inr.inr.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
y z : α
h₁ : z = y
h₂ : True
⊢ y = z

Next tactic:
simp [h₁, h₂]
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> simp [h₁, h₂] at * <;> simp [h₁, h₂]
  · 

Proof state:
case mpr
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y z w : α
⊢ x = z ∧ y = w ∨ x = w ∧ y = z → ((x = z ∨ x = w) ∧ (y = z ∨ y = w)) ∧ (z = x ∨ z = y) ∧ (w = x ∨ w = y)

Next tactic:
rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> simp [h₁, h₂] at * <;> simp [h₁, h₂]
  · rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) <;> 

Proof state:
case mpr.inl.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y : α
⊢ ((x = x ∨ x = y) ∧ (y = x ∨ y = y)) ∧ (x = x ∨ x = y) ∧ (y = x ∨ y = y)

Next tactic:
simp
theorem pair_eq_pair_iff {x y z w : α} :
    ({x, y} : Set α) = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z := by
  simp only [Set.Subset.antisymm_iff, Set.insert_subset_iff, Set.mem_insert_iff,
    Set.mem_singleton_iff, Set.singleton_subset_iff]
  constructor
  · rintro ⟨⟨rfl | rfl, rfl | rfl⟩, ⟨h₁, h₂⟩⟩ <;> simp [h₁, h₂] at * <;> simp [h₁, h₂]
  · rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) <;> 

Proof state:
case mpr.inr.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x y : α
⊢ ((x = y ∨ x = x) ∧ (y = y ∨ y = x)) ∧ (y = x ∨ y = y) ∧ (x = x ∨ x = y)

Next tactic:
simp
theorem sep_ext_iff : { x ∈ s | p x } = { x ∈ s | q x } ↔ ∀ x ∈ s, p x ↔ q x := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
p q : α → Prop
x : α
⊢ {x | x ∈ s ∧ p x} = {x | x ∈ s ∧ q x} ↔ ∀ x ∈ s, p x ↔ q x

Next tactic:
simp_rw [ext_iff, mem_sep_iff, and_congr_right_iff]
@[simp]
theorem sep_eq_self_iff_mem_true : { x ∈ s | p x } = s ↔ ∀ x ∈ s, p x := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
p q : α → Prop
x : α
⊢ {x | x ∈ s ∧ p x} = s ↔ ∀ x ∈ s, p x

Next tactic:
simp_rw [ext_iff, mem_sep_iff, and_iff_left_iff_imp]
@[simp]
theorem sep_eq_empty_iff_mem_false : { x ∈ s | p x } = ∅ ↔ ∀ x ∈ s, ¬p x := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
p q : α → Prop
x : α
⊢ {x | x ∈ s ∧ p x} = ∅ ↔ ∀ x ∈ s, ¬p x

Next tactic:
simp_rw [ext_iff, mem_sep_iff, mem_empty_iff_false, iff_false_iff, not_and]
theorem subset_singleton_iff_eq {s : Set α} {x : α} : s ⊆ {x} ↔ s = ∅ ∨ s = {x} := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
x : α
⊢ s ⊆ {x} ↔ s = ∅ ∨ s = {x}

Next tactic:
obtain rfl | hs := s.eq_empty_or_nonempty
theorem subset_singleton_iff_eq {s : Set α} {x : α} : s ⊆ {x} ↔ s = ∅ ∨ s = {x} := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · 

Proof state:
case inl
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
⊢ ∅ ⊆ {x} ↔ ∅ = ∅ ∨ ∅ = {x}

Next tactic:
exact ⟨fun _ => Or.inl rfl, fun _ => empty_subset _⟩
theorem subset_singleton_iff_eq {s : Set α} {x : α} : s ⊆ {x} ↔ s = ∅ ∨ s = {x} := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · exact ⟨fun _ => Or.inl rfl, fun _ => empty_subset _⟩
  · 

Proof state:
case inr
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
x : α
hs : Set.Nonempty s
⊢ s ⊆ {x} ↔ s = ∅ ∨ s = {x}

Next tactic:
simp [eq_singleton_iff_nonempty_unique_mem, hs, hs.ne_empty]
theorem ssubset_singleton_iff {s : Set α} {x : α} : s ⊂ {x} ↔ s = ∅ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
x : α
⊢ s ⊂ {x} ↔ s = ∅

Next tactic:
rw [ssubset_iff_subset_ne, subset_singleton_iff_eq, or_and_right, and_not_self_iff, or_false_iff,
    and_iff_left_iff_imp]
theorem ssubset_singleton_iff {s : Set α} {x : α} : s ⊂ {x} ↔ s = ∅ := by
  rw [ssubset_iff_subset_ne, subset_singleton_iff_eq, or_and_right, and_not_self_iff, or_false_iff,
    and_iff_left_iff_imp]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
x : α
⊢ s = ∅ → s ≠ {x}

Next tactic:
exact fun h => h ▸ (singleton_ne_empty _).symm
theorem disjoint_right : Disjoint s t ↔ ∀ ⦃a⦄, a ∈ t → a ∉ s := by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Disjoint s t ↔ ∀ ⦃a : α⦄, a ∈ t → a ∉ s

Next tactic:
rw [disjoint_comm, disjoint_left]
lemma disjoint_iff_forall_ne : Disjoint s t ↔ ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ t → a ≠ b := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Disjoint s t ↔ ∀ ⦃a : α⦄, a ∈ s → ∀ ⦃b : α⦄, b ∈ t → a ≠ b

Next tactic:
simp only [Ne.def, disjoint_left, @imp_not_comm _ (_ = _), forall_eq']
@[simp default+1]
lemma disjoint_singleton_left : Disjoint {a} s ↔ a ∉ s := by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Disjoint {a} s ↔ a ∉ s

Next tactic:
simp [Set.disjoint_iff, subset_def]
lemma disjoint_singleton : Disjoint ({a} : Set α) {b} ↔ a ≠ b :=
  by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ Disjoint {a} {b} ↔ a ≠ b

Next tactic:
simp
lemma ssubset_iff_sdiff_singleton : s ⊂ t ↔ ∃ a ∈ t, s ⊆ t \ {a} := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ s ⊂ t ↔ ∃ a ∈ t, s ⊆ t \ {a}

Next tactic:
simp [ssubset_iff_insert, subset_diff, insert_subset_iff]
lemma ssubset_iff_sdiff_singleton : s ⊂ t ↔ ∃ a ∈ t, s ⊆ t \ {a} := by
  simp [ssubset_iff_insert, subset_diff, insert_subset_iff]; 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ (∃ a ∉ s, a ∈ t ∧ s ⊆ t) ↔ ∃ a ∈ t, s ⊆ t ∧ a ∉ s

Next tactic:
aesop
@[simp] lemma nonempty_compl_of_nontrivial [Nontrivial α] (x : α) : Set.Nonempty {x}ᶜ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Nontrivial α
x : α
⊢ Set.Nonempty {x}ᶜ

Next tactic:
obtain ⟨y, hy⟩ := exists_ne x
@[simp] lemma nonempty_compl_of_nontrivial [Nontrivial α] (x : α) : Set.Nonempty {x}ᶜ := by
  obtain ⟨y, hy⟩ := exists_ne x
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Nontrivial α
x y : α
hy : y ≠ x
⊢ Set.Nonempty {x}ᶜ

Next tactic:
exact ⟨y, by simp [hy]⟩
@[simp] lemma nonempty_compl_of_nontrivial [Nontrivial α] (x : α) : Set.Nonempty {x}ᶜ := by
  obtain ⟨y, hy⟩ := exists_ne x
  exact ⟨y, by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Nontrivial α
x y : α
hy : y ≠ x
⊢ y ∈ {x}ᶜ

Next tactic:
simp [hy]
@[simp]
theorem compl_union_self (s : Set α) : sᶜ ∪ s = univ := by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ sᶜ ∪ s = univ

Next tactic:
rw [union_comm, union_compl_self]
theorem inter_compl_nonempty_iff {s t : Set α} : (s ∩ tᶜ).Nonempty ↔ ¬s ⊆ t :=
  (not_subset.trans <| exists_congr fun x => by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
x : α
⊢ x ∈ s ∧ x ∉ t ↔ x ∈ s ∩ tᶜ

Next tactic:
simp [mem_compl]
theorem diff_eq_compl_inter {s t : Set α} : s \ t = tᶜ ∩ s := by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ s \ t = tᶜ ∩ s

Next tactic:
rw [diff_eq, inter_comm]
@[simp]
theorem diff_union_inter (s t : Set α) : s \ t ∪ s ∩ t = s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ s \ t ∪ s ∩ t = s

Next tactic:
rw [union_comm]
@[simp]
theorem diff_union_inter (s t : Set α) : s \ t ∪ s ∩ t = s := by
  rw [union_comm]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
⊢ s ∩ t ∪ s \ t = s

Next tactic:
exact sup_inf_sdiff _ _
@[simp]
theorem diff_singleton_subset_iff {x : α} {s t : Set α} : s \ {x} ⊆ t ↔ s ⊆ insert x t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u : Set α
x : α
s t : Set α
⊢ s \ {x} ⊆ t ↔ s ⊆ insert x t

Next tactic:
rw [← union_singleton, union_comm]
@[simp]
theorem diff_singleton_subset_iff {x : α} {s t : Set α} : s \ {x} ⊆ t ↔ s ⊆ insert x t := by
  rw [← union_singleton, union_comm]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u : Set α
x : α
s t : Set α
⊢ s \ {x} ⊆ t ↔ s ⊆ {x} ∪ t

Next tactic:
apply diff_subset_iff
theorem subset_insert_diff_singleton (x : α) (s : Set α) : s ⊆ insert x (s \ {x}) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u : Set α
x : α
s : Set α
⊢ s ⊆ insert x (s \ {x})

Next tactic:
rw [← diff_singleton_subset_iff]
@[simp]
theorem insert_diff_of_mem (s) (h : a ∈ t) : insert a s \ t = s \ t := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
h : a ∈ t
⊢ insert a s \ t = s \ t

Next tactic:
ext
@[simp]
theorem insert_diff_of_mem (s) (h : a ∈ t) : insert a s \ t = s \ t := by
  ext
  

Proof state:
case h
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
h : a ∈ t
x✝ : α
⊢ x✝ ∈ insert a s \ t ↔ x✝ ∈ s \ t

Next tactic:
constructor