data.prod.tprod

# Finite products of types #

This file defines the product of types over a list. For l : list ι and α : ι → Type* we define list.tprod α l = l.foldr (λ i β, α i × β) punit. This type should not be used if Π i, α i or Π i ∈ l, α i can be used instead (in the last expression, we could also replace the list l by a set or a finset). This type is used as an intermediary between binary products and finitary products. The application of this type is finitary product measures, but it could be used in any construction/theorem that is easier to define/prove on binary products than on finitary products.

• Once we have the construction on binary products (like binary product measures in measure_theory.prod), we can easily define a finitary version on the type tprod l α by iterating. Properties can also be easily extended from the binary case to the finitary case by iterating.
• Then we can use the equivalence list.tprod.pi_equiv_tprod below (or enhanced versions of it, like a measurable_equiv for product measures) to get the construction on Π i : ι, α i, at least when assuming [fintype ι] [encodable ι] (using encodable.sorted_univ). Using local attribute [instance] fintype.to_encodable we can get rid of the argument [encodable ι].

## Main definitions #

• We have the equivalence tprod.pi_equiv_tprod : (Π i, α i) ≃ tprod α l if l contains every element of ι exactly once.
• The product of sets is set.tprod : (Π i, set (α i)) → set (tprod α l).
def list.tprod {ι : Type u_1} (α : ι → Type u_2) (l : list ι) :
Type (max u_2 u_3)

The product of a family of types over a list.

Equations
Instances for list.tprod
@[protected]
def list.tprod.mk {ι : Type u_1} {α : ι → Type u_2} (l : list ι) (f : Π (i : ι), α i) :
l

Turning a function f : Π i, α i into an element of the iterated product tprod α l.

Equations
@[protected, instance]
def list.tprod.inhabited {ι : Type u_1} {α : ι → Type u_2} {l : list ι} [Π (i : ι), inhabited (α i)] :
Equations
@[simp]
theorem list.tprod.fst_mk {ι : Type u_1} {α : ι → Type u_2} (i : ι) (l : list ι) (f : Π (i : ι), α i) :
(list.tprod.mk (i :: l) f).fst = f i
@[simp]
theorem list.tprod.snd_mk {ι : Type u_1} {α : ι → Type u_2} (i : ι) (l : list ι) (f : Π (i : ι), α i) :
(list.tprod.mk (i :: l) f).snd =
@[protected]
def list.tprod.elim {ι : Type u_1} {α : ι → Type u_2} [decidable_eq ι] {l : list ι} (v : l) {i : ι} (hi : i l) :
α i

Given an element of the iterated product l.prod α, take a projection into direction i. If i appears multiple times in l, this chooses the first component in direction i.

Equations
• v.elim hj = dite (j = i) (λ (hji : j = i), eq.rec (λ (v : (j :: is)) (hj : j j :: is), v.fst) hji v hj) (λ (hji : ¬j = i), _)
@[simp]
theorem list.tprod.elim_self {ι : Type u_1} {α : ι → Type u_2} {i : ι} {l : list ι} [decidable_eq ι] (v : (i :: l)) :
v.elim _ = v.fst
@[simp]
theorem list.tprod.elim_of_ne {ι : Type u_1} {α : ι → Type u_2} {i j : ι} {l : list ι} [decidable_eq ι] (hj : j i :: l) (hji : j i) (v : (i :: l)) :
v.elim hj =
@[simp]
theorem list.tprod.elim_of_mem {ι : Type u_1} {α : ι → Type u_2} {i j : ι} {l : list ι} [decidable_eq ι] (hl : (i :: l).nodup) (hj : j l) (v : (i :: l)) :
v.elim _ = hj
theorem list.tprod.elim_mk {ι : Type u_1} {α : ι → Type u_2} [decidable_eq ι] (l : list ι) (f : Π (i : ι), α i) {i : ι} (hi : i l) :
f).elim hi = f i
@[ext]
theorem list.tprod.ext {ι : Type u_1} {α : ι → Type u_2} [decidable_eq ι] {l : list ι} (hl : l.nodup) {v w : l} (hvw : ∀ (i : ι) (hi : i l), v.elim hi = w.elim hi) :
v = w
@[protected, simp]
def list.tprod.elim' {ι : Type u_1} {α : ι → Type u_2} {l : list ι} [decidable_eq ι] (h : ∀ (i : ι), i l) (v : l) (i : ι) :
α i

A version of tprod.elim when l contains all elements. In this case we get a function into Π i, α i.

Equations
theorem list.tprod.mk_elim {ι : Type u_1} {α : ι → Type u_2} {l : list ι} [decidable_eq ι] (hnd : l.nodup) (h : ∀ (i : ι), i l) (v : l) :
v) = v
def list.tprod.pi_equiv_tprod {ι : Type u_1} {α : ι → Type u_2} {l : list ι} [decidable_eq ι] (hnd : l.nodup) (h : ∀ (i : ι), i l) :
(Π (i : ι), α i) l

Pi-types are equivalent to iterated products.

Equations
@[protected, simp]
def set.tprod {ι : Type u_1} {α : ι → Type u_2} (l : list ι) (t : Π (i : ι), set (α i)) :
set l)

A product of sets in tprod α l.

Equations
theorem set.mk_preimage_tprod {ι : Type u_1} {α : ι → Type u_2} (l : list ι) (t : Π (i : ι), set (α i)) :
= {i : ι | i l}.pi t
theorem set.elim_preimage_pi {ι : Type u_1} {α : ι → Type u_2} [decidable_eq ι] {l : list ι} (hnd : l.nodup) (h : ∀ (i : ι), i l) (t : Π (i : ι), set (α i)) :
= t