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)
⊢ l.prod.snd =
    (List.map (fun x => (List.take x.1 (List.map fst l)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst l)).prod)
        l.enum).sum
state_after: 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
⊢ [].prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst [])).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst [])).prod)
        [].enum).sum

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 :
  xs.prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst xs)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod)
        xs.enum).sum
⊢ (x :: xs).prod.snd =
    (List.map
        (fun x_1 =>
          (List.take x_1.1 (List.map fst (x :: xs))).prod •> x_1.2.snd <•
            (List.drop x_1.1.succ (List.map fst (x :: xs))).prod)
        (x :: xs).enum).sum

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
⊢ [].prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst [])).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst [])).prod)
        [].enum).sum
state_after: no goals

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 :
  xs.prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst xs)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod)
        xs.enum).sum
⊢ (x :: xs).prod.snd =
    (List.map
        (fun x_1 =>
          (List.take x_1.1 (List.map fst (x :: xs))).prod •> x_1.2.snd <•
            (List.drop x_1.1.succ (List.map fst (x :: xs))).prod)
        (x :: xs).enum).sum
state_after: 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 :
  xs.prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst xs)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod)
        xs.enum).sum
⊢ (x :: xs).prod.snd =
    (List.map
        (fun x_1 =>
          (List.take x_1.1 (List.map fst (x :: xs))).prod •> x_1.2.snd <•
            (List.drop x_1.1.succ (List.map fst (x :: xs))).prod)
        ((0, x) :: List.map (Prod.map (fun x => x + 1) id) xs.enum)).sum

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,
  ← smul_comm (_ : R) (_ : Rᵐᵒᵖ)]
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 :
  xs.prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst xs)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod)
        xs.enum).sum
⊢ (x :: xs).prod.snd =
    (List.map
        (fun x_1 =>
          (List.take x_1.1 (List.map fst (x :: xs))).prod •> x_1.2.snd <•
            (List.drop x_1.1.succ (List.map fst (x :: xs))).prod)
        ((0, x) :: List.map (Prod.map (fun x => x + 1) id) xs.enum)).sum
state_after: 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 :
  xs.prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst xs)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod)
        xs.enum).sum
⊢ (List.map
          ((fun x_1 => x.fst •> x_1) ∘ fun x =>
            (List.take x.1 (List.map fst xs)).prod •> (x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod))
          xs.enum).sum +
      x.snd <• (List.map fst xs).prod =
    x.snd <• (List.map fst xs).prod +
      (List.map
          (fun x_1 =>
            x.fst •>
              (List.take x_1.1 (List.map fst xs)).prod •> (x_1.2.snd <• (List.drop (x_1.1 + 1) (List.map fst xs)).prod))
          xs.enum).sum

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 :
  xs.prod.snd =
    (List.map
        (fun x => (List.take x.1 (List.map fst xs)).prod •> x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod)
        xs.enum).sum
⊢ (List.map
          ((fun x_1 => x.fst •> x_1) ∘ fun x =>
            (List.take x.1 (List.map fst xs)).prod •> (x.2.snd <• (List.drop x.1.succ (List.map fst xs)).prod))
          xs.enum).sum +
      x.snd <• (List.map fst xs).prod =
    x.snd <• (List.map fst xs).prod +
      (List.map
          (fun x_1 =>
            x.fst •>
              (List.take x_1.1 (List.map fst xs)).prod •> (x_1.2.snd <• (List.drop (x_1.1 + 1) (List.map fst xs)).prod))
          xs.enum).sum
state_after: no goals