List scan #
Prove basic results about List.scanl and List.scanr.
List.scanl #
List.scanr #
partialSums/partialProd #
@[simp]
theorem
List.partialSums_cons
{α : Type u_1}
{a : α}
[Add α]
[Zero α]
[Std.Associative fun (x1 x2 : α) => x1 + x2]
[Std.LawfulIdentity (fun (x1 x2 : α) => x1 + x2) 0]
{l : List α}
:
theorem
List.partialSums_append
{α : Type u_1}
[Add α]
[Zero α]
[Std.Associative fun (x1 x2 : α) => x1 + x2]
[Std.LawfulIdentity (fun (x1 x2 : α) => x1 + x2) 0]
{l₁ l₂ : List α}
:
@[simp]
theorem
List.getElem_partialSums
{α : Type u_1}
{i : Nat}
[Add α]
[Zero α]
[Std.Associative fun (x1 x2 : α) => x1 + x2]
[Std.LawfulIdentity (fun (x1 x2 : α) => x1 + x2) 0]
{l : List α}
(h : i < l.partialSums.length)
:
theorem
List.partialProds_cons
{α : Type u_1}
{a : α}
[Mul α]
[One α]
[Std.Associative fun (x1 x2 : α) => x1 * x2]
[Std.LawfulIdentity (fun (x1 x2 : α) => x1 * x2) 1]
{l : List α}
:
theorem
List.partialProds_append
{α : Type u_1}
[Mul α]
[One α]
[Std.Associative fun (x1 x2 : α) => x1 * x2]
[Std.LawfulIdentity (fun (x1 x2 : α) => x1 * x2) 1]
{l₁ l₂ : List α}
:
@[simp]
theorem
List.getElem_partialProds
{α : Type u_1}
{i : Nat}
[Mul α]
[One α]
[Std.Associative fun (x1 x2 : α) => x1 * x2]
[Std.LawfulIdentity (fun (x1 x2 : α) => x1 * x2) 1]
{l : List α}
(h : i < l.partialProds.length)
: