l3lab/ntp-mathlib huggingface dataset:
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
⊢ ↑s ⊆ ⋃ i, f i → ∃ i, ↑s ⊆ f i

Next tactic:
refine' s.induction_on _ _
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · 

Proof state:
case refine'_1
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
⊢ ↑∅ ⊆ ⋃ i, f i → ∃ i, ↑∅ ⊆ f i

Next tactic:
refine' fun _ => ⟨hn.some, _⟩
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      

Proof state:
case refine'_1
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
x✝ : ↑∅ ⊆ ⋃ i, f i
⊢ ↑∅ ⊆ f (Nonempty.some hn)

Next tactic:
simp only [coe_empty, Set.empty_subset]
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · 

Proof state:
case refine'_2
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
⊢ ∀ ⦃a : α⦄ {s : Finset α},
    a ∉ s → (↑s ⊆ ⋃ i, f i → ∃ i, ↑s ⊆ f i) → ↑(insert a s) ⊆ ⋃ i, f i → ∃ i, ↑(insert a s) ⊆ f i

Next tactic:
intro b t _hbt htc hbtc
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      

Proof state:
case refine'_2
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
⊢ ∃ i, ↑(insert b t) ⊆ f i

Next tactic:
obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
      

Proof state:
case refine'_2.intro
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
i : ι
hti : ↑t ⊆ f i
⊢ ∃ i, ↑(insert b t) ⊆ f i

Next tactic:
obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
      obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by 

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
i : ι
hti : ↑t ⊆ f i
⊢ ∃ j, b ∈ f j

Next tactic:
simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
      obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
      

Proof state:
case refine'_2.intro.intro
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
i : ι
hti : ↑t ⊆ f i
j : ι
hbj : b ∈ f j
⊢ ∃ i, ↑(insert b t) ⊆ f i

Next tactic:
rcases h j i with ⟨k, hk, hk'⟩
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
      obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
      rcases h j i with ⟨k, hk, hk'⟩
      

Proof state:
case refine'_2.intro.intro.intro.intro
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
i : ι
hti : ↑t ⊆ f i
j : ι
hbj : b ∈ f j
k : ι
hk : f j ⊆ f k
hk' : f i ⊆ f k
⊢ ∃ i, ↑(insert b t) ⊆ f i

Next tactic:
use k
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
      obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
      rcases h j i with ⟨k, hk, hk'⟩
      use k
      

Proof state:
case h
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
i : ι
hti : ↑t ⊆ f i
j : ι
hbj : b ∈ f j
k : ι
hk : f j ⊆ f k
hk' : f i ⊆ f k
⊢ ↑(insert b t) ⊆ f k

Next tactic:
rw [coe_insert, Set.insert_subset_iff]
theorem _root_.Directed.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} [hn : Nonempty ι]
    {f : ι → Set α} (h : Directed (· ⊆ ·) f) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i, f i) :
    ∃ i, (s : Set α) ⊆ f i := by
  classical
    revert hs
    refine' s.induction_on _ _
    · refine' fun _ => ⟨hn.some, _⟩
      simp only [coe_empty, Set.empty_subset]
    · intro b t _hbt htc hbtc
      obtain ⟨i : ι, hti : (t : Set α) ⊆ f i⟩ := htc (Set.Subset.trans (t.subset_insert b) hbtc)
      obtain ⟨j, hbj⟩ : ∃ j, b ∈ f j := by simpa [Set.mem_iUnion₂] using hbtc (t.mem_insert_self b)
      rcases h j i with ⟨k, hk, hk'⟩
      use k
      rw [coe_insert, Set.insert_subset_iff]
      

Proof state:
case h
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α✝
a b✝ : α✝
α : Type u_4
ι : Type u_5
hn : Nonempty ι
f : ι → Set α
h : Directed (fun x x_1 => x ⊆ x_1) f
s : Finset α
b : α
t : Finset α
_hbt : b ∉ t
htc : ↑t ⊆ ⋃ i, f i → ∃ i, ↑t ⊆ f i
hbtc : ↑(insert b t) ⊆ ⋃ i, f i
i : ι
hti : ↑t ⊆ f i
j : ι
hbj : b ∈ f j
k : ι
hk : f j ⊆ f k
hk' : f i ⊆ f k
⊢ b ∈ f k ∧ ↑t ⊆ f k

Next tactic:
exact ⟨hk hbj, _root_.trans hti hk'⟩
theorem _root_.DirectedOn.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} {f : ι → Set α}
    {c : Set ι} (hn : c.Nonempty) (hc : DirectedOn (fun i j => f i ⊆ f j) c) {s : Finset α}
    (hs : (s : Set α) ⊆ ⋃ i ∈ c, f i) : ∃ i ∈ c, (s : Set α) ⊆ f i := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
f : ι → Set α
c : Set ι
hn : Set.Nonempty c
hc : DirectedOn (fun i j => f i ⊆ f j) c
s : Finset α
hs : ↑s ⊆ ⋃ i ∈ c, f i
⊢ ∃ i ∈ c, ↑s ⊆ f i

Next tactic:
rw [Set.biUnion_eq_iUnion] at hs
theorem _root_.DirectedOn.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} {f : ι → Set α}
    {c : Set ι} (hn : c.Nonempty) (hc : DirectedOn (fun i j => f i ⊆ f j) c) {s : Finset α}
    (hs : (s : Set α) ⊆ ⋃ i ∈ c, f i) : ∃ i ∈ c, (s : Set α) ⊆ f i := by
  rw [Set.biUnion_eq_iUnion] at hs
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
f : ι → Set α
c : Set ι
hn : Set.Nonempty c
hc : DirectedOn (fun i j => f i ⊆ f j) c
s : Finset α
hs : ↑s ⊆ ⋃ x, f ↑x
⊢ ∃ i ∈ c, ↑s ⊆ f i

Next tactic:
haveI := hn.coe_sort
theorem _root_.DirectedOn.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} {f : ι → Set α}
    {c : Set ι} (hn : c.Nonempty) (hc : DirectedOn (fun i j => f i ⊆ f j) c) {s : Finset α}
    (hs : (s : Set α) ⊆ ⋃ i ∈ c, f i) : ∃ i ∈ c, (s : Set α) ⊆ f i := by
  rw [Set.biUnion_eq_iUnion] at hs
  haveI := hn.coe_sort
  

Proof state:
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
f : ι → Set α
c : Set ι
hn : Set.Nonempty c
hc : DirectedOn (fun i j => f i ⊆ f j) c
s : Finset α
hs : ↑s ⊆ ⋃ x, f ↑x
this : Nonempty ↑c
⊢ ∃ i ∈ c, ↑s ⊆ f i

Next tactic:
obtain ⟨⟨i, hic⟩, hi⟩ :=
    (directed_comp.2 hc.directed_val).exists_mem_subset_of_finset_subset_biUnion hs
theorem _root_.DirectedOn.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} {f : ι → Set α}
    {c : Set ι} (hn : c.Nonempty) (hc : DirectedOn (fun i j => f i ⊆ f j) c) {s : Finset α}
    (hs : (s : Set α) ⊆ ⋃ i ∈ c, f i) : ∃ i ∈ c, (s : Set α) ⊆ f i := by
  rw [Set.biUnion_eq_iUnion] at hs
  haveI := hn.coe_sort
  obtain ⟨⟨i, hic⟩, hi⟩ :=
    (directed_comp.2 hc.directed_val).exists_mem_subset_of_finset_subset_biUnion hs
  

Proof state:
case intro.mk
α✝ : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α✝
s✝ s₁ s₂ t t₁ t₂ u v : Finset α✝
a b : α✝
α : Type u_4
ι : Type u_5
f : ι → Set α
c : Set ι
hn : Set.Nonempty c
hc : DirectedOn (fun i j => f i ⊆ f j) c
s : Finset α
hs : ↑s ⊆ ⋃ x, f ↑x
this : Nonempty ↑c
i : ι
hic : i ∈ c
hi : ↑s ⊆ ((fun j => f j) ∘ Subtype.val) { val := i, property := hic }
⊢ ∃ i ∈ c, ↑s ⊆ f i

Next tactic:
exact ⟨i, hic, hi⟩
theorem subset_inter {s₁ s₂ u : Finset α} : s₁ ⊆ s₂ → s₁ ⊆ u → s₁ ⊆ s₂ ∩ u := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u✝ v : Finset α
a b : α
s₁ s₂ u : Finset α
⊢ s₁ ⊆ s₂ → s₁ ⊆ u → s₁ ⊆ s₂ ∩ u

Next tactic:
simp (config := { contextual := true }) [subset_iff, mem_inter]
@[simp]
theorem union_inter_cancel_left {s t : Finset α} : (s ∪ t) ∩ s = s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b : α
s t : Finset α
⊢ (s ∪ t) ∩ s = s

Next tactic:
rw [← coe_inj, coe_inter, coe_union, Set.union_inter_cancel_left]
@[simp]
theorem union_inter_cancel_right {s t : Finset α} : (s ∪ t) ∩ t = t := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b : α
s t : Finset α
⊢ (s ∪ t) ∩ t = t

Next tactic:
rw [← coe_inj, coe_inter, coe_union, Set.union_inter_cancel_right]
theorem inter_comm (s₁ s₂ : Finset α) : s₁ ∩ s₂ = s₂ ∩ s₁ :=
  ext fun _ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a b : α
s₁ s₂ : Finset α
x✝ : α
⊢ x✝ ∈ s₁ ∩ s₂ ↔ x✝ ∈ s₂ ∩ s₁

Next tactic:
simp only [mem_inter, and_comm]
@[simp]
theorem inter_assoc (s₁ s₂ s₃ : Finset α) : s₁ ∩ s₂ ∩ s₃ = s₁ ∩ (s₂ ∩ s₃) :=
  ext fun _ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a b : α
s₁ s₂ s₃ : Finset α
x✝ : α
⊢ x✝ ∈ s₁ ∩ s₂ ∩ s₃ ↔ x✝ ∈ s₁ ∩ (s₂ ∩ s₃)

Next tactic:
simp only [mem_inter, and_assoc]
theorem inter_left_comm (s₁ s₂ s₃ : Finset α) : s₁ ∩ (s₂ ∩ s₃) = s₂ ∩ (s₁ ∩ s₃) :=
  ext fun _ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a b : α
s₁ s₂ s₃ : Finset α
x✝ : α
⊢ x✝ ∈ s₁ ∩ (s₂ ∩ s₃) ↔ x✝ ∈ s₂ ∩ (s₁ ∩ s₃)

Next tactic:
simp only [mem_inter, and_left_comm]
theorem inter_right_comm (s₁ s₂ s₃ : Finset α) : s₁ ∩ s₂ ∩ s₃ = s₁ ∩ s₃ ∩ s₂ :=
  ext fun _ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a b : α
s₁ s₂ s₃ : Finset α
x✝ : α
⊢ x✝ ∈ s₁ ∩ s₂ ∩ s₃ ↔ x✝ ∈ s₁ ∩ s₃ ∩ s₂

Next tactic:
simp only [mem_inter, and_right_comm]
@[simp]
theorem inter_empty (s : Finset α) : s ∩ ∅ = ∅ :=
  ext fun _ => mem_inter.trans <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a b : α
s : Finset α
x✝ : α
⊢ x✝ ∈ s ∧ x✝ ∈ ∅ ↔ x✝ ∈ ∅

Next tactic:
simp
@[simp]
theorem empty_inter (s : Finset α) : ∅ ∩ s = ∅ :=
  ext fun _ => mem_inter.trans <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a b : α
s : Finset α
x✝ : α
⊢ x✝ ∈ ∅ ∧ x✝ ∈ s ↔ x✝ ∈ ∅

Next tactic:
simp
@[simp]
theorem inter_union_self (s t : Finset α) : s ∩ (t ∪ s) = s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b : α
s t : Finset α
⊢ s ∩ (t ∪ s) = s

Next tactic:
rw [inter_comm, union_inter_cancel_right]
@[simp]
theorem insert_inter_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₂) :
    insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂) :=
  ext fun x => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∈ s₂
x : α
⊢ x ∈ insert a s₁ ∩ s₂ ↔ x ∈ insert a (s₁ ∩ s₂)

Next tactic:
have : x = a ∨ x ∈ s₂ ↔ x ∈ s₂ := or_iff_right_of_imp <| by rintro rfl; exact h
@[simp]
theorem insert_inter_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₂) :
    insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂) :=
  ext fun x => by
    have : x = a ∨ x ∈ s₂ ↔ x ∈ s₂ := or_iff_right_of_imp <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∈ s₂
x : α
⊢ x = a → x ∈ s₂

Next tactic:
rintro rfl
@[simp]
theorem insert_inter_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₂) :
    insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂) :=
  ext fun x => by
    have : x = a ∨ x ∈ s₂ ↔ x ∈ s₂ := or_iff_right_of_imp <| by rintro rfl; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a b : α
s₁ s₂ : Finset α
x : α
h : x ∈ s₂
⊢ x ∈ s₂

Next tactic:
exact h
@[simp]
theorem insert_inter_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₂) :
    insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂) :=
  ext fun x => by
    have : x = a ∨ x ∈ s₂ ↔ x ∈ s₂ := or_iff_right_of_imp <| by rintro rfl; exact h
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∈ s₂
x : α
this : x = a ∨ x ∈ s₂ ↔ x ∈ s₂
⊢ x ∈ insert a s₁ ∩ s₂ ↔ x ∈ insert a (s₁ ∩ s₂)

Next tactic:
simp only [mem_inter, mem_insert, or_and_left, this]
@[simp]
theorem inter_insert_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₁) :
    s₁ ∩ insert a s₂ = insert a (s₁ ∩ s₂) := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∈ s₁
⊢ s₁ ∩ insert a s₂ = insert a (s₁ ∩ s₂)

Next tactic:
rw [inter_comm, insert_inter_of_mem h, inter_comm]
@[simp]
theorem insert_inter_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₂) :
    insert a s₁ ∩ s₂ = s₁ ∩ s₂ :=
  ext fun x => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∉ s₂
x : α
⊢ x ∈ insert a s₁ ∩ s₂ ↔ x ∈ s₁ ∩ s₂

Next tactic:
have : ¬(x = a ∧ x ∈ s₂) := by rintro ⟨rfl, H⟩; exact h H
@[simp]
theorem insert_inter_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₂) :
    insert a s₁ ∩ s₂ = s₁ ∩ s₂ :=
  ext fun x => by
    have : ¬(x = a ∧ x ∈ s₂) := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∉ s₂
x : α
⊢ ¬(x = a ∧ x ∈ s₂)

Next tactic:
rintro ⟨rfl, H⟩
@[simp]
theorem insert_inter_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₂) :
    insert a s₁ ∩ s₂ = s₁ ∩ s₂ :=
  ext fun x => by
    have : ¬(x = a ∧ x ∈ s₂) := by rintro ⟨rfl, H⟩; 

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a b : α
s₁ s₂ : Finset α
x : α
H : x ∈ s₂
h : x ∉ s₂
⊢ False

Next tactic:
exact h H
@[simp]
theorem insert_inter_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₂) :
    insert a s₁ ∩ s₂ = s₁ ∩ s₂ :=
  ext fun x => by
    have : ¬(x = a ∧ x ∈ s₂) := by rintro ⟨rfl, H⟩; exact h H
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∉ s₂
x : α
this : ¬(x = a ∧ x ∈ s₂)
⊢ x ∈ insert a s₁ ∩ s₂ ↔ x ∈ s₁ ∩ s₂

Next tactic:
simp only [mem_inter, mem_insert, or_and_right, this, false_or_iff]
@[simp]
theorem inter_insert_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₁) :
    s₁ ∩ insert a s₂ = s₁ ∩ s₂ := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁✝ s₂✝ t t₁ t₂ u v : Finset α
a✝ b : α
s₁ s₂ : Finset α
a : α
h : a ∉ s₁
⊢ s₁ ∩ insert a s₂ = s₁ ∩ s₂

Next tactic:
rw [inter_comm, insert_inter_of_not_mem h, inter_comm]
@[simp]
theorem singleton_inter_of_mem {a : α} {s : Finset α} (H : a ∈ s) : {a} ∩ s = {a} :=
  show insert a ∅ ∩ s = insert a ∅ by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a✝ b a : α
s : Finset α
H : a ∈ s
⊢ insert a ∅ ∩ s = insert a ∅

Next tactic:
rw [insert_inter_of_mem H, empty_inter]
@[simp]
theorem singleton_inter_of_not_mem {a : α} {s : Finset α} (H : a ∉ s) : {a} ∩ s = ∅ :=
  eq_empty_of_forall_not_mem <| by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a✝ b a : α
s : Finset α
H : a ∉ s
⊢ ∀ (x : α), x ∉ {a} ∩ s

Next tactic:
simp only [mem_inter, mem_singleton]
@[simp]
theorem singleton_inter_of_not_mem {a : α} {s : Finset α} (H : a ∉ s) : {a} ∩ s = ∅ :=
  eq_empty_of_forall_not_mem <| by
    simp only [mem_inter, mem_singleton]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a✝ b a : α
s : Finset α
H : a ∉ s
⊢ ∀ (x : α), ¬(x = a ∧ x ∈ s)

Next tactic:
rintro x ⟨rfl, h⟩
@[simp]
theorem singleton_inter_of_not_mem {a : α} {s : Finset α} (H : a ∉ s) : {a} ∩ s = ∅ :=
  eq_empty_of_forall_not_mem <| by
    simp only [mem_inter, mem_singleton]; rintro x ⟨rfl, h⟩; 

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a b : α
s : Finset α
x : α
h : x ∈ s
H : x ∉ s
⊢ False

Next tactic:
exact H h
@[simp]
theorem inter_singleton_of_mem {a : α} {s : Finset α} (h : a ∈ s) : s ∩ {a} = {a} := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a✝ b a : α
s : Finset α
h : a ∈ s
⊢ s ∩ {a} = {a}

Next tactic:
rw [inter_comm, singleton_inter_of_mem h]
@[simp]
theorem inter_singleton_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : s ∩ {a} = ∅ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t t₁ t₂ u v : Finset α
a✝ b a : α
s : Finset α
h : a ∉ s
⊢ s ∩ {a} = ∅

Next tactic:
rw [inter_comm, singleton_inter_of_not_mem h]
@[mono]
theorem inter_subset_inter {x y s t : Finset α} (h : x ⊆ y) (h' : s ⊆ t) : x ∩ s ⊆ y ∩ t := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b : α
x y s t : Finset α
h : x ⊆ y
h' : s ⊆ t
⊢ x ∩ s ⊆ y ∩ t

Next tactic:
intro a a_in
@[mono]
theorem inter_subset_inter {x y s t : Finset α} (h : x ⊆ y) (h' : s ⊆ t) : x ∩ s ⊆ y ∩ t := by
  intro a a_in
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a✝ b : α
x y s t : Finset α
h : x ⊆ y
h' : s ⊆ t
a : α
a_in : a ∈ x ∩ s
⊢ a ∈ y ∩ t

Next tactic:
rw [Finset.mem_inter] at a_in ⊢
@[mono]
theorem inter_subset_inter {x y s t : Finset α} (h : x ⊆ y) (h' : s ⊆ t) : x ∩ s ⊆ y ∩ t := by
  intro a a_in
  rw [Finset.mem_inter] at a_in ⊢
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a✝ b : α
x y s t : Finset α
h : x ⊆ y
h' : s ⊆ t
a : α
a_in : a ∈ x ∧ a ∈ s
⊢ a ∈ y ∧ a ∈ t

Next tactic:
exact ⟨h a_in.1, h' a_in.2⟩
instance : DistribLattice (Finset α) :=
  { le_sup_inf := fun a b c => by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁ s₂ t t₁ t₂ u v : Finset α
a✝ b✝ : α
a b c : Finset α
⊢ (a ⊔ b) ⊓ (a ⊔ c) ≤ a ⊔ b ⊓ c

Next tactic:
simp (config := { contextual := true }) only
        [sup_eq_union, inf_eq_inter, le_eq_subset, subset_iff, mem_inter, mem_union, and_imp,
        or_imp, true_or_iff, imp_true_iff, true_and_iff, or_true_iff]
theorem not_disjoint_iff_nonempty_inter : ¬Disjoint s t ↔ (s ∩ t).Nonempty :=
  not_disjoint_iff.trans <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s s₁ s₂ t t₁ t₂ u v : Finset α
a b : α
⊢ (∃ a ∈ s, a ∈ t) ↔ Finset.Nonempty (s ∩ t)

Next tactic:
simp [Finset.Nonempty]
theorem disjoint_or_nonempty_inter (s t : Finset α) : Disjoint s t ∨ (s ∩ t).Nonempty := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s✝ s₁ s₂ t✝ t₁ t₂ u v : Finset α
a b : α
s t : Finset α
⊢ _root_.Disjoint s t ∨ Finset.Nonempty (s ∩ t)

Next tactic:
rw [← not_disjoint_iff_nonempty_inter]