Lemmas for tuples Fin m → α #
This file contains alternative definitions of common operators on vectors which expand
definitionally to the expected expression when evaluated on ![] notation.
This allows "proof by reflection", where we prove f = ![f 0, f 1] by defining
FinVec.etaExpand f to be equal to the RHS definitionally, and then prove that
f = etaExpand f.
The definitions in this file should normally not be used directly; the intent is for the
corresponding *_eq lemmas to be used in a place where they are definitionally unfolded.
Main definitions #
Evaluate FinVec.seq f v = ![(f 0) (v 0), (f 1) (v 1), ...]
Instances For
FinVec.map f v = ![f (v 0), f (v 1), ...]
Instances For
This can be used to prove
example {f : α → β} (a₁ a₂ : α) : f ∘ ![a₁, a₂] = ![f a₁, f a₂] :=
(map_eq _ _).symm
Expand v to ![v 0, v 1, ...]
Instances For
∀ with better defeq for ∀ x : Fin m → α, P x.
Instances For
This can be used to prove
example (P : (Fin 2 → α) → Prop) : (∀ f, P f) ↔ ∀ a₀ a₁, P ![a₀, a₁] :=
(forall_iff _).symm
∃ with better defeq for ∃ x : Fin m → α, P x.
Instances For
This can be used to prove
example (P : (Fin 2 → α) → Prop) : (∃ f, P f) ↔ ∃ a₀ a₁, P ![a₀, a₁] :=
(exists_iff _).symm
Finset.univ.sum with better defeq for Fin.
Instances For
Finset.univ.prod with better defeq for Fin.
Instances For
This can be used to prove
example [CommMonoid α] (a : Fin 3 → α) : ∏ i, a i = a 0 * a 1 * a 2 :=
(prod_eq _).symm
This can be used to prove
example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
(sum_eq _).symm
Produce a term of the form f 0 * f 1 * ... * f (n - 1) and an application of FinVec.prod_eq
that shows it is equal to ∏ i, f i.
Instances For
Produce a term of the form f 0 + f 1 + ... + f (n - 1) and an application of FinVec.sum_eq
that shows it is equal to ∑ i, f i.
Instances For
Rewrites ∏ i : Fin n, f i as f 0 * f 1 * ... * f (n - 1) when n is a numeral.
Instances For
Rewrites ∑ i : Fin n, f i as f 0 + f 1 + ... + f (n - 1) when n is a numeral.