Cardinalities of set differences of finsets #
Finset.card_sdiff_insert_add_one: adding an elementa ∈ T \ StoSlowers the number of elements ofToutsideSby one.Finset.subset_induction: downward induction onS ⊆ T, fromTitself and steps fromS ∪ {a}toS. Mathlib'sFinset.induction_on'is the upward analogue.Finset.card_sdiff_lt_of_card_eq_min: ifF ⊆ Uhasmin k #Uelements of a nonemptyUandT ⊆ Uhas fewer thank, then fewer elements ofTlie outsideFthan inF.
theorem
Finset.subset_induction
{ι : Type u_1}
[DecidableEq ι]
{T : Finset ι}
{P : (S : Finset ι) → S ⊆ T → Prop}
(self : P T ⋯)
(step : ∀ (S : Finset ι), ∀ a ∉ S, ∀ (h : insert a S ⊆ T), P (insert a S) h → P S ⋯)
(S : Finset ι)
(h : S ⊆ T)
:
P S h
Downward induction on S ⊆ T: a property holding at T, and passing from S ∪ {a} to S,
holds for every S ⊆ T.
theorem
Finset.card_sdiff_lt_of_card_eq_min
{ι : Type u_1}
[DecidableEq ι]
{F T U : Finset ι}
{k : ℕ}
(hFU : F ⊆ U)
(hTU : T ⊆ U)
(hU : U.Nonempty)
(hF : F.card = min k U.card)
(hT : T.card < k)
:
If F has min k #U of the elements of a nonempty set U, and T ⊆ U has fewer than k
elements, then fewer elements of T lie outside F than in F.