Theorem: Finset.powerset_len_sup
File: Mathlib/Data/Finset/Powerset.lean

tactic: apply le_antisymm
state_before: α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
⊢ sup (powersetLen (Nat.succ n) u) id = u

tactic: simp_rw [Finset.sup_le_iff, mem_powersetLen]
state_before: case a
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
⊢ sup (powersetLen (Nat.succ n) u) id ≤ u

tactic: rintro x ⟨h, -⟩
state_before: case a
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
⊢ ∀ (b : Finset α), b ⊆ u ∧ card b = Nat.succ n → id b ≤ u

tactic: exact h
state_before: case a.intro
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
x : Finset α
h : x ⊆ u
⊢ id x ≤ u

tactic: rw [sup_eq_biUnion, le_iff_subset, subset_iff]
state_before: case a
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
⊢ u ≤ sup (powersetLen (Nat.succ n) u) id

tactic: cases' (Nat.succ_le_of_lt hn).eq_or_lt with h' h'
state_before: case a
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
⊢ ∀ ⦃x : α⦄, x ∈ u → x ∈ Finset.biUnion (powersetLen (Nat.succ n) u) id

tactic: simp [h']
state_before: case a.inl
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n = card u
⊢ ∀ ⦃x : α⦄, x ∈ u → x ∈ Finset.biUnion (powersetLen (Nat.succ n) u) id

tactic: intro x hx
state_before: case a.inr
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n < card u
⊢ ∀ ⦃x : α⦄, x ∈ u → x ∈ Finset.biUnion (powersetLen (Nat.succ n) u) id

tactic: simp only [mem_biUnion, exists_prop, id.def]
state_before: case a.inr
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n < card u
x : α
hx : x ∈ u
⊢ x ∈ Finset.biUnion (powersetLen (Nat.succ n) u) id

tactic: obtain ⟨t, ht⟩ : ∃ t, t ∈ powersetLen n (u.erase x) := powersetLen_nonempty
  (le_trans (Nat.le_pred_of_lt hn) pred_card_le_card_erase)
state_before: case a.inr
α : Type u_1
s t : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n < card u
x : α
hx : x ∈ u
⊢ ∃ a, a ∈ powersetLen (Nat.succ n) u ∧ x ∈ a

tactic: refine' ⟨insert x t, _, mem_insert_self _ _⟩
state_before: case a.inr.intro
α : Type u_1
s t✝ : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n < card u
x : α
hx : x ∈ u
t : Finset α
ht : t ∈ powersetLen n (erase u x)
⊢ ∃ a, a ∈ powersetLen (Nat.succ n) u ∧ x ∈ a

tactic: rw [← insert_erase hx, powersetLen_succ_insert (not_mem_erase _ _)]
state_before: case a.inr.intro
α : Type u_1
s t✝ : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n < card u
x : α
hx : x ∈ u
t : Finset α
ht : t ∈ powersetLen n (erase u x)
⊢ insert x t ∈ powersetLen (Nat.succ n) u

tactic: exact mem_union_right _ (mem_image_of_mem _ ht)
state_before: case a.inr.intro
α : Type u_1
s t✝ : Finset α
inst✝ : DecidableEq α
u : Finset α
n : ℕ
hn : n < card u
h' : Nat.succ n < card u
x : α
hx : x ∈ u
t : Finset α
ht : t ∈ powersetLen n (erase u x)
⊢ insert x t ∈ powersetLen (Nat.succ n) (erase u x) ∪ image (insert x) (powersetLen n (erase u x))