l3lab/ntp-mathlib huggingface dataset:
/-- Dependent version of `Submodule.pow_induction_on_right`. -/
@[elab_as_elim]
protected theorem pow_induction_on_right' {C : ∀ (n : ℕ) (x), x ∈ M ^ n → Prop}
    (hr : ∀ r : R, C 0 (algebraMap _ _ r) (algebraMap_mem r))
    (hadd : ∀ x y i hx hy, C i x hx → C i y hy → C i (x + y) (add_mem ‹_› ‹_›))
    (hmul :
      ∀ i x hx, C i x hx →
        ∀ m (hm : m ∈ M), C i.succ (x * m) ((pow_succ' M i).symm ▸ mul_mem_mul hx hm))
    -- porting note: swapped argument order to match order of `C`
    {n : ℕ} {x : A} (hx : x ∈ M ^ n) : C n x hx := by
  induction' n with n n_ih generalizing x
  · rw [pow_zero] at hx
    

Proof state:
case zero
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n : A
C : (n : ℕ) → (x : A) → x ∈ M ^ n → Prop
hr : ∀ (r : R), C 0 ((algebraMap R A) r) (_ : (algebraMap R A) r ∈ 1)
hadd : ∀ (x y : A) (i : ℕ) (hx : x ∈ M ^ i) (hy : y ∈ M ^ i), C i x hx → C i y hy → C i (x + y) (_ : x + y ∈ M ^ i)
hmul :
  ∀ (i : ℕ) (x : A) (hx : x ∈ M ^ i),
    C i x hx → ∀ (m : A) (hm : m ∈ M), C (Nat.succ i) (x * m) (_ : x * m ∈ M ^ (i + 1))
x : A
hx✝ : x ∈ M ^ Nat.zero
hx : x ∈ 1
⊢ C Nat.zero x hx✝

Next tactic:
obtain ⟨r, rfl⟩ := hx
/-- Dependent version of `Submodule.pow_induction_on_right`. -/
@[elab_as_elim]
protected theorem pow_induction_on_right' {C : ∀ (n : ℕ) (x), x ∈ M ^ n → Prop}
    (hr : ∀ r : R, C 0 (algebraMap _ _ r) (algebraMap_mem r))
    (hadd : ∀ x y i hx hy, C i x hx → C i y hy → C i (x + y) (add_mem ‹_› ‹_›))
    (hmul :
      ∀ i x hx, C i x hx →
        ∀ m (hm : m ∈ M), C i.succ (x * m) ((pow_succ' M i).symm ▸ mul_mem_mul hx hm))
    -- porting note: swapped argument order to match order of `C`
    {n : ℕ} {x : A} (hx : x ∈ M ^ n) : C n x hx := by
  induction' n with n n_ih generalizing x
  · rw [pow_zero] at hx
    obtain ⟨r, rfl⟩ := hx
    

Proof state:
case zero.intro
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n : A
C : (n : ℕ) → (x : A) → x ∈ M ^ n → Prop
hr : ∀ (r : R), C 0 ((algebraMap R A) r) (_ : (algebraMap R A) r ∈ 1)
hadd : ∀ (x y : A) (i : ℕ) (hx : x ∈ M ^ i) (hy : y ∈ M ^ i), C i x hx → C i y hy → C i (x + y) (_ : x + y ∈ M ^ i)
hmul :
  ∀ (i : ℕ) (x : A) (hx : x ∈ M ^ i),
    C i x hx → ∀ (m : A) (hm : m ∈ M), C (Nat.succ i) (x * m) (_ : x * m ∈ M ^ (i + 1))
r : R
hx : (Algebra.linearMap R A) r ∈ M ^ Nat.zero
⊢ C Nat.zero ((Algebra.linearMap R A) r) hx

Next tactic:
exact hr r
/-- Dependent version of `Submodule.pow_induction_on_right`. -/
@[elab_as_elim]
protected theorem pow_induction_on_right' {C : ∀ (n : ℕ) (x), x ∈ M ^ n → Prop}
    (hr : ∀ r : R, C 0 (algebraMap _ _ r) (algebraMap_mem r))
    (hadd : ∀ x y i hx hy, C i x hx → C i y hy → C i (x + y) (add_mem ‹_› ‹_›))
    (hmul :
      ∀ i x hx, C i x hx →
        ∀ m (hm : m ∈ M), C i.succ (x * m) ((pow_succ' M i).symm ▸ mul_mem_mul hx hm))
    -- porting note: swapped argument order to match order of `C`
    {n : ℕ} {x : A} (hx : x ∈ M ^ n) : C n x hx := by
  induction' n with n n_ih generalizing x
  · rw [pow_zero] at hx
    obtain ⟨r, rfl⟩ := hx
    exact hr r
  

Proof state:
case succ
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n✝ : A
C : (n : ℕ) → (x : A) → x ∈ M ^ n → Prop
hr : ∀ (r : R), C 0 ((algebraMap R A) r) (_ : (algebraMap R A) r ∈ 1)
hadd : ∀ (x y : A) (i : ℕ) (hx : x ∈ M ^ i) (hy : y ∈ M ^ i), C i x hx → C i y hy → C i (x + y) (_ : x + y ∈ M ^ i)
hmul :
  ∀ (i : ℕ) (x : A) (hx : x ∈ M ^ i),
    C i x hx → ∀ (m : A) (hm : m ∈ M), C (Nat.succ i) (x * m) (_ : x * m ∈ M ^ (i + 1))
n : ℕ
n_ih : ∀ {x : A} (hx : x ∈ M ^ n), C n x hx
x : A
hx : x ∈ M ^ Nat.succ n
⊢ C (Nat.succ n) x hx

Next tactic:
revert hx
/-- Dependent version of `Submodule.pow_induction_on_right`. -/
@[elab_as_elim]
protected theorem pow_induction_on_right' {C : ∀ (n : ℕ) (x), x ∈ M ^ n → Prop}
    (hr : ∀ r : R, C 0 (algebraMap _ _ r) (algebraMap_mem r))
    (hadd : ∀ x y i hx hy, C i x hx → C i y hy → C i (x + y) (add_mem ‹_› ‹_›))
    (hmul :
      ∀ i x hx, C i x hx →
        ∀ m (hm : m ∈ M), C i.succ (x * m) ((pow_succ' M i).symm ▸ mul_mem_mul hx hm))
    -- porting note: swapped argument order to match order of `C`
    {n : ℕ} {x : A} (hx : x ∈ M ^ n) : C n x hx := by
  induction' n with n n_ih generalizing x
  · rw [pow_zero] at hx
    obtain ⟨r, rfl⟩ := hx
    exact hr r
  revert hx
  

Proof state:
case succ
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n✝ : A
C : (n : ℕ) → (x : A) → x ∈ M ^ n → Prop
hr : ∀ (r : R), C 0 ((algebraMap R A) r) (_ : (algebraMap R A) r ∈ 1)
hadd : ∀ (x y : A) (i : ℕ) (hx : x ∈ M ^ i) (hy : y ∈ M ^ i), C i x hx → C i y hy → C i (x + y) (_ : x + y ∈ M ^ i)
hmul :
  ∀ (i : ℕ) (x : A) (hx : x ∈ M ^ i),
    C i x hx → ∀ (m : A) (hm : m ∈ M), C (Nat.succ i) (x * m) (_ : x * m ∈ M ^ (i + 1))
n : ℕ
n_ih : ∀ {x : A} (hx : x ∈ M ^ n), C n x hx
x : A
⊢ ∀ (hx : x ∈ M ^ Nat.succ n), C (Nat.succ n) x hx

Next tactic:
simp_rw [pow_succ']
/-- Dependent version of `Submodule.pow_induction_on_right`. -/
@[elab_as_elim]
protected theorem pow_induction_on_right' {C : ∀ (n : ℕ) (x), x ∈ M ^ n → Prop}
    (hr : ∀ r : R, C 0 (algebraMap _ _ r) (algebraMap_mem r))
    (hadd : ∀ x y i hx hy, C i x hx → C i y hy → C i (x + y) (add_mem ‹_› ‹_›))
    (hmul :
      ∀ i x hx, C i x hx →
        ∀ m (hm : m ∈ M), C i.succ (x * m) ((pow_succ' M i).symm ▸ mul_mem_mul hx hm))
    -- porting note: swapped argument order to match order of `C`
    {n : ℕ} {x : A} (hx : x ∈ M ^ n) : C n x hx := by
  induction' n with n n_ih generalizing x
  · rw [pow_zero] at hx
    obtain ⟨r, rfl⟩ := hx
    exact hr r
  revert hx
  simp_rw [pow_succ']
  

Proof state:
case succ
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n✝ : A
C : (n : ℕ) → (x : A) → x ∈ M ^ n → Prop
hr : ∀ (r : R), C 0 ((algebraMap R A) r) (_ : (algebraMap R A) r ∈ 1)
hadd : ∀ (x y : A) (i : ℕ) (hx : x ∈ M ^ i) (hy : y ∈ M ^ i), C i x hx → C i y hy → C i (x + y) (_ : x + y ∈ M ^ i)
hmul :
  ∀ (i : ℕ) (x : A) (hx : x ∈ M ^ i),
    C i x hx → ∀ (m : A) (hm : m ∈ M), C (Nat.succ i) (x * m) (_ : x * m ∈ M ^ (i + 1))
n : ℕ
n_ih : ∀ {x : A} (hx : x ∈ M ^ n), C n x hx
x : A
⊢ ∀ (hx : x ∈ M ^ n * M), C (Nat.succ n) x (_ : x ∈ M ^ Nat.succ n)

Next tactic:
intro hx
/-- Dependent version of `Submodule.pow_induction_on_right`. -/
@[elab_as_elim]
protected theorem pow_induction_on_right' {C : ∀ (n : ℕ) (x), x ∈ M ^ n → Prop}
    (hr : ∀ r : R, C 0 (algebraMap _ _ r) (algebraMap_mem r))
    (hadd : ∀ x y i hx hy, C i x hx → C i y hy → C i (x + y) (add_mem ‹_› ‹_›))
    (hmul :
      ∀ i x hx, C i x hx →
        ∀ m (hm : m ∈ M), C i.succ (x * m) ((pow_succ' M i).symm ▸ mul_mem_mul hx hm))
    -- porting note: swapped argument order to match order of `C`
    {n : ℕ} {x : A} (hx : x ∈ M ^ n) : C n x hx := by
  induction' n with n n_ih generalizing x
  · rw [pow_zero] at hx
    obtain ⟨r, rfl⟩ := hx
    exact hr r
  revert hx
  simp_rw [pow_succ']
  intro hx
  

Proof state:
case succ
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n✝ : A
C : (n : ℕ) → (x : A) → x ∈ M ^ n → Prop
hr : ∀ (r : R), C 0 ((algebraMap R A) r) (_ : (algebraMap R A) r ∈ 1)
hadd : ∀ (x y : A) (i : ℕ) (hx : x ∈ M ^ i) (hy : y ∈ M ^ i), C i x hx → C i y hy → C i (x + y) (_ : x + y ∈ M ^ i)
hmul :
  ∀ (i : ℕ) (x : A) (hx : x ∈ M ^ i),
    C i x hx → ∀ (m : A) (hm : m ∈ M), C (Nat.succ i) (x * m) (_ : x * m ∈ M ^ (i + 1))
n : ℕ
n_ih : ∀ {x : A} (hx : x ∈ M ^ n), C n x hx
x : A
hx : x ∈ M ^ n * M
⊢ C (Nat.succ n) x (_ : x ∈ M ^ Nat.succ n)

Next tactic:
exact
    Submodule.mul_induction_on' (fun m hm x ih => hmul _ _ hm (n_ih _) _ ih)
      (fun x hx y hy Cx Cy => hadd _ _ _ _ _ Cx Cy) hx
/-- The ring of submodules of the opposite algebra is isomorphic to the opposite ring of
submodules. -/
@[simps apply symm_apply]
def equivOpposite : Submodule R Aᵐᵒᵖ ≃+* (Submodule R A)ᵐᵒᵖ where
  toFun p := op <| p.comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ)
  invFun p := p.unop.comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A)
  left_inv p := SetLike.coe_injective <| rfl
  right_inv p := unop_injective <| SetLike.coe_injective rfl
  map_add' p q := by 

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n : A
p q : Submodule R Aᵐᵒᵖ
⊢ Equiv.toFun
      { toFun := fun p => op (comap (↑(opLinearEquiv R)) p),
        invFun := fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p),
        left_inv :=
          (_ :
            ∀ (p : Submodule R Aᵐᵒᵖ),
              (fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p))
                  ((fun p => op (comap (↑(opLinearEquiv R)) p)) p) =
                p),
        right_inv :=
          (_ :
            ∀ (p : (Submodule R A)ᵐᵒᵖ),
              (fun p => op (comap (↑(opLinearEquiv R)) p))
                  ((fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p)) p) =
                p) }
      (p + q) =
    Equiv.toFun
        { toFun := fun p => op (comap (↑(opLinearEquiv R)) p),
          invFun := fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p),
          left_inv :=
            (_ :
              ∀ (p : Submodule R Aᵐᵒᵖ),
                (fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p))
                    ((fun p => op (comap (↑(opLinearEquiv R)) p)) p) =
                  p),
          right_inv :=
            (_ :
              ∀ (p : (Submodule R A)ᵐᵒᵖ),
                (fun p => op (comap (↑(opLinearEquiv R)) p))
                    ((fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p)) p) =
                  p) }
        p +
      Equiv.toFun
        { toFun := fun p => op (comap (↑(opLinearEquiv R)) p),
          invFun := fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p),
          left_inv :=
            (_ :
              ∀ (p : Submodule R Aᵐᵒᵖ),
                (fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p))
                    ((fun p => op (comap (↑(opLinearEquiv R)) p)) p) =
                  p),
          right_inv :=
            (_ :
              ∀ (p : (Submodule R A)ᵐᵒᵖ),
                (fun p => op (comap (↑(opLinearEquiv R)) p))
                    ((fun p => comap (↑(LinearEquiv.symm (opLinearEquiv R))) (unop p)) p) =
                  p) }
        q

Next tactic:
simp [comap_equiv_eq_map_symm, ← op_add]
theorem map_op_pow (n : ℕ) :
    map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M ^ n) =
      map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M ^ n := by
  

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n✝ : A
n : ℕ
⊢ map (↑(opLinearEquiv R)) (M ^ n) = map (↑(opLinearEquiv R)) M ^ n

Next tactic:
rw [map_equiv_eq_comap_symm, map_equiv_eq_comap_symm, comap_unop_pow]
theorem map_unop_pow (n : ℕ) (M : Submodule R Aᵐᵒᵖ) :
    map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) (M ^ n) =
      map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M ^ n := by
  

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M✝ N P Q : Submodule R A
m n✝ : A
n : ℕ
M : Submodule R Aᵐᵒᵖ
⊢ map (↑(LinearEquiv.symm (opLinearEquiv R))) (M ^ n) = map (↑(LinearEquiv.symm (opLinearEquiv R))) M ^ n

Next tactic:
rw [← comap_equiv_eq_map_symm, ← comap_equiv_eq_map_symm, comap_op_pow]
/-- `span` is a semiring homomorphism (recall multiplication is pointwise multiplication of subsets
on either side). -/
@[simps]
def span.ringHom : SetSemiring A →+* Submodule R A where
  toFun s := Submodule.span R (SetSemiring.down s)
  map_zero' := span_empty
  map_one' := one_eq_span.symm
  map_add' := span_union
  map_mul' s t := by
    

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n : A
s t : SetSemiring A
⊢ OneHom.toFun { toFun := fun s => span R (SetSemiring.down s), map_one' := (_ : span R {1} = 1) } (s * t) =
    OneHom.toFun { toFun := fun s => span R (SetSemiring.down s), map_one' := (_ : span R {1} = 1) } s *
      OneHom.toFun { toFun := fun s => span R (SetSemiring.down s), map_one' := (_ : span R {1} = 1) } t

Next tactic:
dsimp only
/-- `span` is a semiring homomorphism (recall multiplication is pointwise multiplication of subsets
on either side). -/
@[simps]
def span.ringHom : SetSemiring A →+* Submodule R A where
  toFun s := Submodule.span R (SetSemiring.down s)
  map_zero' := span_empty
  map_one' := one_eq_span.symm
  map_add' := span_union
  map_mul' s t := by
    dsimp only -- porting note: new, needed due to new-style structures
    

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : Semiring A
inst✝ : Algebra R A
S T : Set A
M N P Q : Submodule R A
m n : A
s t : SetSemiring A
⊢ span R (SetSemiring.down (s * t)) = span R (SetSemiring.down s) * span R (SetSemiring.down t)

Next tactic:
rw [SetSemiring.down_mul, span_mul_span, ← image_mul_prod]
theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) :
    (∏ i in s, Submodule.span R (M i)) = Submodule.span R (∏ i in s, M i) := by
  

Proof state:
ι✝ : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n : A
ι : Type u_1
s : Finset ι
M : ι → Set A
⊢ ∏ i in s, span R (M i) = span R (∏ i in s, M i)

Next tactic:
letI := Classical.decEq ι
theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) :
    (∏ i in s, Submodule.span R (M i)) = Submodule.span R (∏ i in s, M i) := by
  letI := Classical.decEq ι
  

Proof state:
ι✝ : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n : A
ι : Type u_1
s : Finset ι
M : ι → Set A
this : DecidableEq ι := Classical.decEq ι
⊢ ∏ i in s, span R (M i) = span R (∏ i in s, M i)

Next tactic:
refine' Finset.induction_on s _ _
theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) :
    (∏ i in s, Submodule.span R (M i)) = Submodule.span R (∏ i in s, M i) := by
  letI := Classical.decEq ι
  refine' Finset.induction_on s _ _
  · 

Proof state:
case refine'_1
ι✝ : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n : A
ι : Type u_1
s : Finset ι
M : ι → Set A
this : DecidableEq ι := Classical.decEq ι
⊢ ∏ i in ∅, span R (M i) = span R (∏ i in ∅, M i)

Next tactic:
simp [one_eq_span, Set.singleton_one]
theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) :
    (∏ i in s, Submodule.span R (M i)) = Submodule.span R (∏ i in s, M i) := by
  letI := Classical.decEq ι
  refine' Finset.induction_on s _ _
  · simp [one_eq_span, Set.singleton_one]
  · 

Proof state:
case refine'_2
ι✝ : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n : A
ι : Type u_1
s : Finset ι
M : ι → Set A
this : DecidableEq ι := Classical.decEq ι
⊢ ∀ ⦃a : ι⦄ {s : Finset ι},
    a ∉ s →
      ∏ i in s, span R (M i) = span R (∏ i in s, M i) →
        ∏ i in insert a s, span R (M i) = span R (∏ i in insert a s, M i)

Next tactic:
intro _ _ H ih
theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) :
    (∏ i in s, Submodule.span R (M i)) = Submodule.span R (∏ i in s, M i) := by
  letI := Classical.decEq ι
  refine' Finset.induction_on s _ _
  · simp [one_eq_span, Set.singleton_one]
  · intro _ _ H ih
    

Proof state:
case refine'_2
ι✝ : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n : A
ι : Type u_1
s : Finset ι
M : ι → Set A
this : DecidableEq ι := Classical.decEq ι
a✝ : ι
s✝ : Finset ι
H : a✝ ∉ s✝
ih : ∏ i in s✝, span R (M i) = span R (∏ i in s✝, M i)
⊢ ∏ i in insert a✝ s✝, span R (M i) = span R (∏ i in insert a✝ s✝, M i)

Next tactic:
rw [Finset.prod_insert H, Finset.prod_insert H, ih, span_mul_span]
theorem prod_span_singleton {ι : Type*} (s : Finset ι) (x : ι → A) :
    (∏ i in s, span R ({x i} : Set A)) = span R {∏ i in s, x i} := by
  

Proof state:
ι✝ : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M N : Submodule R A
m n : A
ι : Type u_1
s : Finset ι
x : ι → A
⊢ ∏ i in s, span R {x i} = span R {∏ i in s, x i}

Next tactic:
rw [prod_span, Set.finset_prod_singleton]
/-- R-submodules of the R-algebra A are a module over `Set A`. -/
instance moduleSet : Module (SetSemiring A) (Submodule R A) where
  -- porting note: have to unfold both `HSMul.hSMul` and `SMul.smul`
  smul s P := span R (SetSemiring.down s) * P
  smul_add _ _ _ := mul_add _ _ _
  add_smul s t P := by
    simp_rw [HSMul.hSMul, SetSemiring.down_add, span_union, sup_mul, add_eq_sup]
  mul_smul s t P := by
    simp_rw [HSMul.hSMul, SetSemiring.down_mul, ← mul_assoc, span_mul_span]
  one_smul P := by
    

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M N : Submodule R A
m n : A
P : Submodule R A
⊢ 1 • P = P

Next tactic:
simp_rw [HSMul.hSMul, SetSemiring.down_one, ← one_eq_span_one_set, one_mul]
/-- R-submodules of the R-algebra A are a module over `Set A`. -/
instance moduleSet : Module (SetSemiring A) (Submodule R A) where
  -- porting note: have to unfold both `HSMul.hSMul` and `SMul.smul`
  smul s P := span R (SetSemiring.down s) * P
  smul_add _ _ _ := mul_add _ _ _
  add_smul s t P := by
    simp_rw [HSMul.hSMul, SetSemiring.down_add, span_union, sup_mul, add_eq_sup]
  mul_smul s t P := by
    

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M N : Submodule R A
m n : A
s t : SetSemiring A
P : Submodule R A
⊢ (s * t) • P = s • t • P

Next tactic:
simp_rw [HSMul.hSMul, SetSemiring.down_mul, ← mul_assoc, span_mul_span]
/-- R-submodules of the R-algebra A are a module over `Set A`. -/
instance moduleSet : Module (SetSemiring A) (Submodule R A) where
  -- porting note: have to unfold both `HSMul.hSMul` and `SMul.smul`
  smul s P := span R (SetSemiring.down s) * P
  smul_add _ _ _ := mul_add _ _ _
  add_smul s t P := by
    

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M N : Submodule R A
m n : A
s t : SetSemiring A
P : Submodule R A
⊢ (s + t) • P = s • P + t • P

Next tactic:
simp_rw [HSMul.hSMul, SetSemiring.down_add, span_union, sup_mul, add_eq_sup]
/-- R-submodules of the R-algebra A are a module over `Set A`. -/
instance moduleSet : Module (SetSemiring A) (Submodule R A) where
  -- porting note: have to unfold both `HSMul.hSMul` and `SMul.smul`
  smul s P := span R (SetSemiring.down s) * P
  smul_add _ _ _ := mul_add _ _ _
  add_smul s t P := by
    simp_rw [HSMul.hSMul, SetSemiring.down_add, span_union, sup_mul, add_eq_sup]
  mul_smul s t P := by
    simp_rw [HSMul.hSMul, SetSemiring.down_mul, ← mul_assoc, span_mul_span]
  one_smul P := by
    simp_rw [HSMul.hSMul, SetSemiring.down_one, ← one_eq_span_one_set, one_mul]
  zero_smul P := by
    

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M N : Submodule R A
m n : A
P : Submodule R A
⊢ 0 • P = 0

Next tactic:
simp_rw [HSMul.hSMul, SetSemiring.down_zero, span_empty, bot_mul, bot_eq_zero]
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
⊢ Set.up {a} • M = map (LinearMap.mulLeft R a) M

Next tactic:
conv_lhs => rw [← span_eq M]
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => 

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
| Set.up {a} • M

Next tactic:
rw [← span_eq M]
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
⊢ Set.up {a} • span R ↑M = map (LinearMap.mulLeft R a) M

Next tactic:
change span _ _ * span _ _ = _
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  change span _ _ * span _ _ = _
  

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
⊢ span R (SetSemiring.down (Set.up {a})) * span R ↑M = map (LinearMap.mulLeft R a) M

Next tactic:
rw [span_mul_span]
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  change span _ _ * span _ _ = _
  rw [span_mul_span]
  

Proof state:
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
⊢ span R (SetSemiring.down (Set.up {a}) * ↑M) = map (LinearMap.mulLeft R a) M

Next tactic:
apply le_antisymm
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  change span _ _ * span _ _ = _
  rw [span_mul_span]
  apply le_antisymm
  · 

Proof state:
case a
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
⊢ span R (SetSemiring.down (Set.up {a}) * ↑M) ≤ map (LinearMap.mulLeft R a) M

Next tactic:
rw [span_le]
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  change span _ _ * span _ _ = _
  rw [span_mul_span]
  apply le_antisymm
  · rw [span_le]
    

Proof state:
case a
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m n a : A
M : Submodule R A
⊢ SetSemiring.down (Set.up {a}) * ↑M ⊆ ↑(map (LinearMap.mulLeft R a) M)

Next tactic:
rintro _ ⟨b, m, hb, hm, rfl⟩
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  change span _ _ * span _ _ = _
  rw [span_mul_span]
  apply le_antisymm
  · rw [span_le]
    rintro _ ⟨b, m, hb, hm, rfl⟩
    

Proof state:
case a.intro.intro.intro.intro
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m✝ n a : A
M : Submodule R A
b m : A
hb : b ∈ SetSemiring.down (Set.up {a})
hm : m ∈ ↑M
⊢ (fun x x_1 => x * x_1) b m ∈ ↑(map (LinearMap.mulLeft R a) M)

Next tactic:
rw [SetLike.mem_coe, mem_map, Set.mem_singleton_iff.mp hb]
theorem smul_singleton (a : A) (M : Submodule R A) :
    Set.up ({a} : Set A) • M = M.map (LinearMap.mulLeft R a) := by
  conv_lhs => rw [← span_eq M]
  change span _ _ * span _ _ = _
  rw [span_mul_span]
  apply le_antisymm
  · rw [span_le]
    rintro _ ⟨b, m, hb, hm, rfl⟩
    rw [SetLike.mem_coe, mem_map, Set.mem_singleton_iff.mp hb]
    

Proof state:
case a.intro.intro.intro.intro
ι : Sort uι
R : Type u
inst✝² : CommSemiring R
A : Type v
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
M✝ N : Submodule R A
m✝ n a : A
M : Submodule R A
b m : A
hb : b ∈ SetSemiring.down (Set.up {a})
hm : m ∈ ↑M
⊢ ∃ y ∈ M, (LinearMap.mulLeft R a) y = (fun x x_1 => x * x_1) a m

Next tactic:
exact ⟨m, hm, rfl⟩