The Cartesian product of lists #
Main definitions #
List.pi: Cartesian product of lists indexed by a list.
def
List.Pi.head
{ι : Type u_1}
{α : ι → Sort u_2}
{i : ι}
{l : List ι}
(f : (j : ι) → j ∈ i :: l → α j)
:
α i
Given f a function whose domain is i :: l, get its value at i.
Equations
- List.Pi.head f = f i ⋯
Instances For
def
List.Pi.tail
{ι : Type u_1}
{α : ι → Sort u_2}
{i : ι}
{l : List ι}
(f : (j : ι) → j ∈ i :: l → α j)
(j : ι)
:
j ∈ l → α j
Given f a function whose domain is i :: l, produce a function whose domain
is restricted to l.
Equations
- List.Pi.tail f j hj = f j ⋯
Instances For
def
List.Pi.cons
{ι : Type u_1}
[DecidableEq ι]
{α : ι → Sort u_2}
(i : ι)
(l : List ι)
(a : α i)
(f : (j : ι) → j ∈ l → α j)
(j : ι)
:
Given α : ι → Sort*, a list l and a term i, as well as a term a : α i and a
function f such that f j : α j for all j in l, Pi.cons a f is a function g such
that g k : α k for all k in i :: l.
Equations
- List.Pi.cons i l a f = Multiset.Pi.cons (↑l) i a f
Instances For
@[simp]
theorem
Multiset.Pi.cons_coe
{ι : Type u_1}
[DecidableEq ι]
{α : ι → Sort u_2}
{i : ι}
{l : List ι}
(a : α i)
(f : (j : ι) → j ∈ l → α j)
:
theorem
List.Pi.forall_rel_cons_ext
{ι : Type u_1}
[DecidableEq ι]
{α : ι → Sort u_2}
{i : ι}
{l : List ι}
{r : ⦃i : ι⦄ → α i → α i → Prop}
{a₁ a₂ : α i}
{f₁ f₂ : (j : ι) → j ∈ l → α j}
(ha : r a₁ a₂)
(hf : ∀ (i : ι) (hi : i ∈ l), r (f₁ i hi) (f₂ i hi))
(j : ι)
(hj : j ∈ i :: l)
:
pi xs f creates the list of functions g such that, for x ∈ xs, g x ∈ f x
Equations
- [].pi x✝ = [List.Pi.nil α]
- (i :: l).pi x✝ = List.flatMap (fun (b : α i) => List.map (List.Pi.cons i l b) (l.pi x✝)) (x✝ i)
Instances For
theorem
Multiset.pi_coe
{ι : Type u_1}
[DecidableEq ι]
{α : ι → Type u_2}
(l : List ι)
(fs : (i : ι) → List (α i))
: