Theorem: TrivSqZeroExt.snd_list_prod
File: Mathlib/Algebra/TrivSqZeroExt.lean

tactic: induction' l with x xs ih
state_before: R : Type u
M : Type v
inst✝⁴ : Semiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module Rᵐᵒᵖ M
inst✝ : SMulCommClass R Rᵐᵒᵖ M
l : List (tsze R M)
⊢ snd (List.prod l) =
    List.sum
      (List.map
        (fun x =>
          List.prod (List.take x.fst (List.map fst l)) •
            op (List.prod (List.drop (Nat.succ x.fst) (List.map fst l))) • snd x.snd)
        (List.enum l))

tactic: simp
state_before: case nil
R : Type u
M : Type v
inst✝⁴ : Semiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module Rᵐᵒᵖ M
inst✝ : SMulCommClass R Rᵐᵒᵖ M
⊢ snd (List.prod []) =
    List.sum
      (List.map
        (fun x =>
          List.prod (List.take x.fst (List.map fst [])) •
            op (List.prod (List.drop (Nat.succ x.fst) (List.map fst []))) • snd x.snd)
        (List.enum []))

tactic: rw [List.enum_cons, ← List.map_fst_add_enum_eq_enumFrom]
state_before: case cons
R : Type u
M : Type v
inst✝⁴ : Semiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module Rᵐᵒᵖ M
inst✝ : SMulCommClass R Rᵐᵒᵖ M
x : tsze R M
xs : List (tsze R M)
ih :
  snd (List.prod xs) =
    List.sum
      (List.map
        (fun x =>
          List.prod (List.take x.fst (List.map fst xs)) •
            op (List.prod (List.drop (Nat.succ x.fst) (List.map fst xs))) • snd x.snd)
        (List.enum xs))
⊢ snd (List.prod (x :: xs)) =
    List.sum
      (List.map
        (fun x_1 =>
          List.prod (List.take x_1.fst (List.map fst (x :: xs))) •
            op (List.prod (List.drop (Nat.succ x_1.fst) (List.map fst (x :: xs)))) • snd x_1.snd)
        (List.enum (x :: xs)))

tactic: simp_rw [List.map_cons, List.map_map, Function.comp, Prod.map_snd, Prod.map_fst, id,
  List.take_zero, List.take_cons, List.prod_nil, List.prod_cons, snd_mul, one_smul, List.drop,
  mul_smul, List.sum_cons, fst_list_prod, ih, List.smul_sum, List.map_map]
state_before: case cons
R : Type u
M : Type v
inst✝⁴ : Semiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module Rᵐᵒᵖ M
inst✝ : SMulCommClass R Rᵐᵒᵖ M
x : tsze R M
xs : List (tsze R M)
ih :
  snd (List.prod xs) =
    List.sum
      (List.map
        (fun x =>
          List.prod (List.take x.fst (List.map fst xs)) •
            op (List.prod (List.drop (Nat.succ x.fst) (List.map fst xs))) • snd x.snd)
        (List.enum xs))
⊢ snd (List.prod (x :: xs)) =
    List.sum
      (List.map
        (fun x_1 =>
          List.prod (List.take x_1.fst (List.map fst (x :: xs))) •
            op (List.prod (List.drop (Nat.succ x_1.fst) (List.map fst (x :: xs)))) • snd x_1.snd)
        ((0, x) :: List.map (Prod.map (fun x => x + 1) id) (List.enum xs)))

tactic: exact add_comm _ _
state_before: case cons
R : Type u
M : Type v
inst✝⁴ : Semiring R
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module Rᵐᵒᵖ M
inst✝ : SMulCommClass R Rᵐᵒᵖ M
x : tsze R M
xs : List (tsze R M)
ih :
  snd (List.prod xs) =
    List.sum
      (List.map
        (fun x =>
          List.prod (List.take x.fst (List.map fst xs)) •
            op (List.prod (List.drop (Nat.succ x.fst) (List.map fst xs))) • snd x.snd)
        (List.enum xs))
⊢ List.sum
        (List.map
          ((fun x_1 => fst x • x_1) ∘ fun x =>
            List.prod (List.take x.fst (List.map fst xs)) •
              op (List.prod (List.drop (Nat.succ x.fst) (List.map fst xs))) • snd x.snd)
          (List.enum xs)) +
      op (List.prod (List.map fst xs)) • snd x =
    op (List.prod (List.map fst xs)) • snd x +
      List.sum
        (List.map
          (fun x_1 =>
            fst x •
              List.prod (List.take x_1.fst (List.map fst xs)) •
                op (List.prod (List.drop (x_1.fst + 1) (List.map fst xs))) • snd x_1.snd)
          (List.enum xs))