Constructing finite sets by adding one element #
This file contains the definitions of {a} : Finset α
, insert a s : Finset α
and Finset.cons
,
all ways to construct a Finset
by adding one element.
Main declarations #
Finset.induction_on
: Induction on finsets. To prove a proposition about an arbitraryFinset α
, it suffices to prove it for the empty finset, and to show that if it holds for someFinset α
, then it holds for the finset obtained by inserting a new element.Finset.instSingletonFinset
: Denoted by{a}
; the finset consisting of one element.insert
andFinset.cons
: For anya : α
,insert s a
returnss ∪ {a}
.cons s a h
returns the same except that it requires a hypothesis stating thata
is not already ins
. This does not require decidable equality on the typeα
.
Tags #
finite sets, finset
Subset and strict subset relations #
singleton #
{a} : Finset a
is the set {a}
containing a
and nothing else.
This differs from insert a ∅
in that it does not require a DecidableEq
instance for α
.
Equations
Alias of Finset.notMem_singleton
.
A finset is nontrivial if it has at least two elements.
Equations
Instances For
Alias of the forward direction of Finset.nontrivial_coe
.
Alias of the reverse direction of Finset.nontrivial_coe
.
Equations
cons #
cons a s h
is the set {a} ∪ s
containing a
and the elements of s
. It is the same as
insert a s
when it is defined, but unlike insert a s
it does not require DecidableEq α
,
and the union is guaranteed to be disjoint.
Equations
Instances For
Alias of Finset.eq_of_mem_cons_of_notMem
.
Combine a product with a pi type to pi of cons.
Equations
Instances For
insert #
insert a s
is the set {a} ∪ s
containing a
and the elements of s
.
Equations
Alias of Finset.insert_val_of_notMem
.
Alias of Finset.eq_of_mem_insert_of_notMem
.
A version of LawfulSingleton.insert_empty_eq
that works with dsimp
.
Alias of Finset.insert_comm
.
Alias of Finset.ne_insert_of_notMem
.
To prove a proposition about an arbitrary Finset α
,
it suffices to prove it for the empty Finset
,
and to show that if it holds for some Finset α
,
then it holds for the Finset
obtained by inserting a new element.
To prove a proposition about S : Finset α
,
it suffices to prove it for the empty Finset
,
and to show that if it holds for some Finset α ⊆ S
,
then it holds for the Finset
obtained by inserting a new element of S
.
To prove a proposition about a nonempty s : Finset α
, it suffices to show it holds for all
singletons and that if it holds for nonempty t : Finset α
, then it also holds for the Finset
obtained by inserting an element in t
.
Split the added element of insert off a Pi type.
Equations
Instances For
Combine a product with a pi type to pi of insert.
Equations
Instances For
Useful in proofs by induction.