l3lab/ntp-mathlib huggingface dataset:
theorem ofDirectSum_comp_toDirectSum :
    ofDirectSum.comp toDirectSum = AlgHom.id R (TensorAlgebra R M) := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
⊢ AlgHom.comp ofDirectSum toDirectSum = AlgHom.id R (TensorAlgebra R M)

Next tactic:
ext
theorem ofDirectSum_comp_toDirectSum :
    ofDirectSum.comp toDirectSum = AlgHom.id R (TensorAlgebra R M) := by
  ext
  

Proof state:
case w.h
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
x✝ : M
⊢ (AlgHom.toLinearMap (AlgHom.comp ofDirectSum toDirectSum) ∘ₗ ι R) x✝ =
    (AlgHom.toLinearMap (AlgHom.id R (TensorAlgebra R M)) ∘ₗ ι R) x✝

Next tactic:
simp [DirectSum.lof_eq_of, tprod_apply]
@[simp]
theorem mk_reindex_fin_cast {n m : ℕ} (h : n = m) (x : (⨂[R]^n) M) :
    GradedMonoid.mk (A := fun i => (⨂[R]^i) M) m
    (PiTensorProduct.reindex R M (Fin.castIso h).toEquiv x) = GradedMonoid.mk n x := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n m : ℕ
h : n = m
x : (⨂[R]^n) M
⊢ GradedMonoid.mk m ((PiTensorProduct.reindex R M (Fin.castIso h).toEquiv) x) = GradedMonoid.mk n x

Next tactic:
rw [Fin.castIso_to_equiv, mk_reindex_cast h]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)

Next tactic:
refine' Fin.consInduction _ _ x
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> 

Proof state:
case refine'_1
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x => Fin.elim0 a)) (List.finRange 0)) =
    GradedMonoid.mk 0 ((PiTensorProduct.tprod R) Fin.elim0)

Next tactic:
clear x
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> 

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ ∀ {n : ℕ} (x₀ : M) (x : Fin n → M),
    List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
        GradedMonoid.mk n ((PiTensorProduct.tprod R) x) →
      List.prod
          (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => Fin.cons x₀ x a))
            (List.finRange (n + 1))) =
        GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))

Next tactic:
clear x
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · 

Proof state:
case refine'_1
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
⊢ List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x => Fin.elim0 a)) (List.finRange 0)) =
    GradedMonoid.mk 0 ((PiTensorProduct.tprod R) Fin.elim0)

Next tactic:
rw [List.finRange_zero, List.map_nil, List.prod_nil]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    

Proof state:
case refine'_1
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
⊢ 1 = GradedMonoid.mk 0 ((PiTensorProduct.tprod R) Fin.elim0)

Next tactic:
rfl
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · 

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
⊢ ∀ {n : ℕ} (x₀ : M) (x : Fin n → M),
    List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
        GradedMonoid.mk n ((PiTensorProduct.tprod R) x) →
      List.prod
          (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => Fin.cons x₀ x a))
            (List.finRange (n + 1))) =
        GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))

Next tactic:
intro n x₀ x ih
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ List.prod
      (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => Fin.cons x₀ x a))
        (List.finRange (n + 1))) =
    GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))

Next tactic:
rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => Fin.cons x₀ x 0) *
      List.prod
        (List.map ((fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => Fin.cons x₀ x a)) ∘ Fin.succ)
          (List.finRange n)) =
    GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))

Next tactic:
simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x => x₀) *
      List.prod
        (List.map (fun x_1 => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_2 => x x_1)) (List.finRange n)) =
    GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))

Next tactic:
rw [ih, GradedMonoid.mk_mul_mk, TensorPower.tprod_mul_tprod]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
    rw [ih, GradedMonoid.mk_mul_mk, TensorPower.tprod_mul_tprod]
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ GradedMonoid.mk (1 + n) ((PiTensorProduct.tprod R) (Fin.append (fun x => x₀) x)) =
    GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))

Next tactic:
refine' TensorPower.gradedMonoid_eq_of_cast (add_comm _ _) _
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
    rw [ih, GradedMonoid.mk_mul_mk, TensorPower.tprod_mul_tprod]
    refine' TensorPower.gradedMonoid_eq_of_cast (add_comm _ _) _
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ (TensorPower.cast R M (_ : 1 + n = n + 1))
      (GradedMonoid.mk (1 + n) ((PiTensorProduct.tprod R) (Fin.append (fun x => x₀) x))).snd =
    (GradedMonoid.mk (n + 1) ((PiTensorProduct.tprod R) (Fin.cons x₀ x))).snd

Next tactic:
dsimp only [GradedMonoid.mk]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
    rw [ih, GradedMonoid.mk_mul_mk, TensorPower.tprod_mul_tprod]
    refine' TensorPower.gradedMonoid_eq_of_cast (add_comm _ _) _
    dsimp only [GradedMonoid.mk]
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ (TensorPower.cast R M (_ : 1 + n = n + 1)) ((PiTensorProduct.tprod R) (Fin.append (fun x => x₀) x)) =
    (PiTensorProduct.tprod R) (Fin.cons x₀ x)

Next tactic:
rw [TensorPower.cast_tprod]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
    rw [ih, GradedMonoid.mk_mul_mk, TensorPower.tprod_mul_tprod]
    refine' TensorPower.gradedMonoid_eq_of_cast (add_comm _ _) _
    dsimp only [GradedMonoid.mk]
    rw [TensorPower.cast_tprod]
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ (PiTensorProduct.tprod R) (Fin.append (fun x => x₀) x ∘ Fin.cast (_ : n + 1 = 1 + n)) =
    (PiTensorProduct.tprod R) (Fin.cons x₀ x)

Next tactic:
simp_rw [Fin.append_left_eq_cons, Function.comp]
/-- The product of tensor products made of a single vector is the same as a single product of
all the vectors. -/
theorem _root_.TensorPower.list_prod_gradedMonoid_mk_single (n : ℕ) (x : Fin n → M) :
    ((List.finRange n).map fun a =>
          (GradedMonoid.mk _ (PiTensorProduct.tprod R fun _ : Fin 1 => x a) :
            GradedMonoid fun n => (⨂[R]^n) M)).prod =
      GradedMonoid.mk n (PiTensorProduct.tprod R x) := by
  refine' Fin.consInduction _ _ x <;> clear x
  · rw [List.finRange_zero, List.map_nil, List.prod_nil]
    rfl
  · intro n x₀ x ih
    rw [List.finRange_succ_eq_map, List.map_cons, List.prod_cons, List.map_map]
    simp_rw [Function.comp, Fin.cons_zero, Fin.cons_succ]
    rw [ih, GradedMonoid.mk_mul_mk, TensorPower.tprod_mul_tprod]
    refine' TensorPower.gradedMonoid_eq_of_cast (add_comm _ _) _
    dsimp only [GradedMonoid.mk]
    rw [TensorPower.cast_tprod]
    simp_rw [Fin.append_left_eq_cons, Function.comp]
    

Proof state:
case refine'_2
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n✝ n : ℕ
x₀ : M
x : Fin n → M
ih :
  List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)
⊢ ((PiTensorProduct.tprod R) fun x_1 =>
      Fin.cons x₀ x (Fin.cast (_ : 1 + n = n + 1) (Fin.cast (_ : n + 1 = 1 + n) x_1))) =
    (PiTensorProduct.tprod R) (Fin.cons x₀ x)

Next tactic:
congr 1 with i
theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x) := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ toDirectSum ((tprod R M n) x) = (DirectSum.of (fun i => (⨂[R]^i) M) n) ((PiTensorProduct.tprod R) x)

Next tactic:
rw [tprod_apply, AlgHom.map_list_prod, List.map_ofFn]
theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x) := by
  rw [tprod_apply, AlgHom.map_list_prod, List.map_ofFn]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ List.prod (List.ofFn (⇑toDirectSum ∘ fun i => (ι R) (x i))) =
    (DirectSum.of (fun i => (⨂[R]^i) M) n) ((PiTensorProduct.tprod R) x)

Next tactic:
simp_rw [Function.comp, toDirectSum_ι]
theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x) := by
  rw [tprod_apply, AlgHom.map_list_prod, List.map_ofFn]
  simp_rw [Function.comp, toDirectSum_ι]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ List.prod (List.ofFn fun x_1 => (DirectSum.of (fun n => (⨂[R]^n) M) 1) ((PiTensorProduct.tprod R) fun x_2 => x x_1)) =
    (DirectSum.of (fun i => (⨂[R]^i) M) n) ((PiTensorProduct.tprod R) x)

Next tactic:
rw [DirectSum.list_prod_ofFn_of_eq_dProd]
theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x) := by
  rw [tprod_apply, AlgHom.map_list_prod, List.map_ofFn]
  simp_rw [Function.comp, toDirectSum_ι]
  rw [DirectSum.list_prod_ofFn_of_eq_dProd]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ (DirectSum.of (fun n => (⨂[R]^n) M) (List.dProdIndex (List.finRange n) fun x => 1))
      (List.dProd (List.finRange n) (fun x => 1) fun x_1 => (PiTensorProduct.tprod R) fun x_2 => x x_1) =
    (DirectSum.of (fun i => (⨂[R]^i) M) n) ((PiTensorProduct.tprod R) x)

Next tactic:
apply DirectSum.of_eq_of_gradedMonoid_eq
theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x) := by
  rw [tprod_apply, AlgHom.map_list_prod, List.map_ofFn]
  simp_rw [Function.comp, toDirectSum_ι]
  rw [DirectSum.list_prod_ofFn_of_eq_dProd]
  apply DirectSum.of_eq_of_gradedMonoid_eq
  

Proof state:
case h
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ GradedMonoid.mk (List.dProdIndex (List.finRange n) fun x => 1)
      (List.dProd (List.finRange n) (fun x => 1) fun x_1 => (PiTensorProduct.tprod R) fun x_2 => x x_1) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)

Next tactic:
rw [GradedMonoid.mk_list_dProd]
theorem toDirectSum_tensorPower_tprod {n} (x : Fin n → M) :
    toDirectSum (tprod R M n x) = DirectSum.of _ n (PiTensorProduct.tprod R x) := by
  rw [tprod_apply, AlgHom.map_list_prod, List.map_ofFn]
  simp_rw [Function.comp, toDirectSum_ι]
  rw [DirectSum.list_prod_ofFn_of_eq_dProd]
  apply DirectSum.of_eq_of_gradedMonoid_eq
  rw [GradedMonoid.mk_list_dProd]
  

Proof state:
case h
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
n : ℕ
x : Fin n → M
⊢ List.prod (List.map (fun a => GradedMonoid.mk 1 ((PiTensorProduct.tprod R) fun x_1 => x a)) (List.finRange n)) =
    GradedMonoid.mk n ((PiTensorProduct.tprod R) x)

Next tactic:
rw [TensorPower.list_prod_gradedMonoid_mk_single]
theorem toDirectSum_comp_ofDirectSum :
    toDirectSum.comp ofDirectSum = AlgHom.id R (⨁ n, (⨂[R]^n) M) := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
⊢ AlgHom.comp toDirectSum ofDirectSum = AlgHom.id R (⨁ (n : ℕ), (⨂[R]^n) M)

Next tactic:
ext
theorem toDirectSum_comp_ofDirectSum :
    toDirectSum.comp ofDirectSum = AlgHom.id R (⨁ n, (⨂[R]^n) M) := by
  ext
  

Proof state:
case h.H.H
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
i✝ : ℕ
x✝ : Fin i✝ → M
⊢ (LinearMap.compMultilinearMap
        (AlgHom.toLinearMap (AlgHom.comp toDirectSum ofDirectSum) ∘ₗ DirectSum.lof R ℕ (fun i => (⨂[R]^i) M) i✝)
        (PiTensorProduct.tprod R))
      x✝ =
    (LinearMap.compMultilinearMap
        (AlgHom.toLinearMap (AlgHom.id R (⨁ (n : ℕ), (⨂[R]^n) M)) ∘ₗ DirectSum.lof R ℕ (fun i => (⨂[R]^i) M) i✝)
        (PiTensorProduct.tprod R))
      x✝

Next tactic:
simp [DirectSum.lof_eq_of, -tprod_apply, toDirectSum_tensorPower_tprod]
@[to_additive]
theorem isMinimal_iff_closed_smul_invariant [ContinuousConstSMul M α] :
    IsMinimal M α ↔ ∀ s : Set α, IsClosed s → (∀ c : M, c • s ⊆ s) → s = ∅ ∨ s = univ := by
  

Proof state:
M : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : Monoid M
inst✝⁴ : Group G
inst✝³ : TopologicalSpace α
inst✝² : MulAction M α
inst✝¹ : MulAction G α
inst✝ : ContinuousConstSMul M α
⊢ IsMinimal M α ↔ ∀ (s : Set α), IsClosed s → (∀ (c : M), c • s ⊆ s) → s = ∅ ∨ s = univ

Next tactic:
constructor
@[to_additive]
theorem isMinimal_iff_closed_smul_invariant [ContinuousConstSMul M α] :
    IsMinimal M α ↔ ∀ s : Set α, IsClosed s → (∀ c : M, c • s ⊆ s) → s = ∅ ∨ s = univ := by
  constructor
  · 

Proof state:
case mp
M : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : Monoid M
inst✝⁴ : Group G
inst✝³ : TopologicalSpace α
inst✝² : MulAction M α
inst✝¹ : MulAction G α
inst✝ : ContinuousConstSMul M α
⊢ IsMinimal M α → ∀ (s : Set α), IsClosed s → (∀ (c : M), c • s ⊆ s) → s = ∅ ∨ s = univ

Next tactic:
intro _ _
@[to_additive]
theorem isMinimal_iff_closed_smul_invariant [ContinuousConstSMul M α] :
    IsMinimal M α ↔ ∀ s : Set α, IsClosed s → (∀ c : M, c • s ⊆ s) → s = ∅ ∨ s = univ := by
  constructor
  · intro _ _
    

Proof state:
case mp
M : Type u_1
G : Type u_2
α : Type u_3
inst✝⁵ : Monoid M
inst✝⁴ : Group G
inst✝³ : TopologicalSpace α
inst✝² : MulAction M α
inst✝¹ : MulAction G α
inst✝ : ContinuousConstSMul M α
a✝ : IsMinimal M α
s✝ : Set α
⊢ IsClosed s✝ → (∀ (c : M), c • s✝ ⊆ s✝) → s✝ = ∅ ∨ s✝ = univ

Next tactic:
exact eq_empty_or_univ_of_smul_invariant_closed M