Equations
- Vector.elems 0 = {#v[]}
- Vector.elems n.succ = (Vector.elems n).biUnion fun (v : Vector α n) => Finset.image v.push Fintype.elems
Instances For
instance
instFintypeVectorOfDecidableEq_validator
{α : Type u_1}
[Fintype α]
[DecidableEq α]
{n : ℕ}
:
Equations
- instFintypeVectorOfDecidableEq_validator = { elems := Vector.elems n, complete := ⋯ }
Use foldr to combine any element of the first list with any element of the second list, the third list, etc. Note that the size of the result is exponential in the number of lists.
Equations
- List.mulr f init = List.foldr (List.productWith f) [init]
Instances For
@[irreducible]
Similar to List.merge, but also remove duplicates.
I tried to combine List.merge with List.dedup, but there are no lemmas for
List.dedup with sorted. There is also Array.mergeDedup, but that also has no lemmas.
Equations
- One or more equations did not get rendered due to their size.
- [].mergeDedup x✝ = x✝
- x✝.mergeDedup [] = x✝
Instances For
theorem
List.mergeDedup_sorted
{α : Type u_1}
[LinearOrder α]
{xs ys : List α}
:
xs.SortedLT → ys.SortedLT → (xs.mergeDedup ys).SortedLT
Equations
- [].insertDedup x✝ = [x✝]
- (x_2 :: xs).insertDedup x✝ = match compare x_2 x✝ with | Ordering.lt => x_2 :: xs.insertDedup x✝ | Ordering.eq => x_2 :: xs | Ordering.gt => x✝ :: x_2 :: xs
Instances For
theorem
List.insertDedup_sorted
{α : Type u_1}
[LinearOrder α]
{xs : List α}
{x : α}
:
xs.SortedLT → (xs.insertDedup x).SortedLT
@[irreducible]
Equations
Instances For
theorem
List.map_toFinset
{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
{xs : List α}
: