l3lab/ntp-mathlib huggingface dataset:
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          

Proof state:
case a.refine'_4.intro.refl.tmul.add
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx✝ : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
a : A
b : B
x y : ↥(Submodule.restrictScalars R I) ⊗[R] B
hx :
  ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
hy :
  ∃ y_1,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y_1 =
      a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y
⊢ ∃ y_1,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y_1 =
      a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) (x + y)

Next tactic:
obtain ⟨x', hx'⟩ := hx
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          

Proof state:
case a.refine'_4.intro.refl.tmul.add.intro
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
a : A
b : B
x y : ↥(Submodule.restrictScalars R I) ⊗[R] B
hy :
  ∃ y_1,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y_1 =
      a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y
x' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hx' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x' =
    a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
⊢ ∃ y_1,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y_1 =
      a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) (x + y)

Next tactic:
obtain ⟨y', hy'⟩ := hy
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          

Proof state:
case a.refine'_4.intro.refl.tmul.add.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
a : A
b : B
x y x' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hx' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x' =
    a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
y' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hy' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y' =
    a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y
⊢ ∃ y_1,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y_1 =
      a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) (x + y)

Next tactic:
use x' + y'
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          use x' + y'
          

Proof state:
case h
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
a : A
b : B
x y x' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hx' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x' =
    a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
y' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hy' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y' =
    a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y
⊢ (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) (x' + y') =
    a ⊗ₜ[R] b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) (x + y)

Next tactic:
simp only [map_add, hx', smul_add, hy']
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          use x' + y'
          simp only [map_add, hx', smul_add, hy']
      

Proof state:
case a.refine'_4.intro.refl.add
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
x : ↥(Submodule.restrictScalars R I) ⊗[R] B
a b : A ⊗[R] B
ha :
  ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      a • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
hb :
  ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
⊢ ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      (a + b) • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x

Next tactic:
| add a b ha hb =>
        obtain ⟨x', ha'⟩ := ha
        obtain ⟨y', hb'⟩ := hb
        use x' + y'
        simp only [map_add, ha', add_smul, hb']
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          use x' + y'
          simp only [map_add, hx', smul_add, hy']
      | add a b ha hb =>
        

Proof state:
case a.refine'_4.intro.refl.add
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
x : ↥(Submodule.restrictScalars R I) ⊗[R] B
a b : A ⊗[R] B
ha :
  ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      a • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
hb :
  ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
⊢ ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      (a + b) • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x

Next tactic:
obtain ⟨x', ha'⟩ := ha
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          use x' + y'
          simp only [map_add, hx', smul_add, hy']
      | add a b ha hb =>
        obtain ⟨x', ha'⟩ := ha
        

Proof state:
case a.refine'_4.intro.refl.add.intro
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
x : ↥(Submodule.restrictScalars R I) ⊗[R] B
a b : A ⊗[R] B
hb :
  ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
x' : ↥(Submodule.restrictScalars R I) ⊗[R] B
ha' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x' =
    a • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
⊢ ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      (a + b) • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x

Next tactic:
obtain ⟨y', hb'⟩ := hb
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          use x' + y'
          simp only [map_add, hx', smul_add, hy']
      | add a b ha hb =>
        obtain ⟨x', ha'⟩ := ha
        obtain ⟨y', hb'⟩ := hb
        

Proof state:
case a.refine'_4.intro.refl.add.intro.intro
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
x : ↥(Submodule.restrictScalars R I) ⊗[R] B
a b : A ⊗[R] B
x' : ↥(Submodule.restrictScalars R I) ⊗[R] B
ha' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x' =
    a • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
y' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hb' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y' =
    b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
⊢ ∃ y,
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y =
      (a + b) • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x

Next tactic:
use x' + y'
/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R))) := by
  rw [← Submodule.carrier_inj]
  apply le_antisymm
  · intro x
    simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
      Submodule.mem_toAddSubmonoid, Submodule.restrictScalars_mem, LinearMap.mem_range]
    intro hx
    rw [Ideal.map, ← submodule_span_eq] at hx
    refine' Submodule.span_induction hx _ _ _ _
    · intro x
      simp only [includeLeft_apply, Set.mem_image, SetLike.mem_coe]
      rintro ⟨y, hy, rfl⟩
      use ⟨y, hy⟩ ⊗ₜ[R] 1
      rfl
    · use 0
      simp only [map_zero]
    · rintro x y ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩
      use x + y
      simp only [map_add]
    · rintro a x ⟨x, hx, rfl⟩
      induction a using TensorProduct.induction_on with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x using TensorProduct.induction_on with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [LinearMap.lTensor_tmul, Submodule.coeSubtype, smul_eq_mul, tmul_mul_tmul]
          rfl
        | add x y hx hy =>
          obtain ⟨x', hx'⟩ := hx
          obtain ⟨y', hy'⟩ := hy
          use x' + y'
          simp only [map_add, hx', smul_add, hy']
      | add a b ha hb =>
        obtain ⟨x', ha'⟩ := ha
        obtain ⟨y', hb'⟩ := hb
        use x' + y'
        

Proof state:
case h
R : Type u_1
inst✝⁴ : CommSemiring R
A : Type u_2
B : Type u_3
inst✝³ : Semiring A
inst✝² : Semiring B
inst✝¹ : Algebra R A
inst✝ : Algebra R B
I : Ideal A
x✝ : A ⊗[R] B
hx : x✝ ∈ Submodule.span (A ⊗[R] B) (⇑includeLeft '' ↑I)
x : ↥(Submodule.restrictScalars R I) ⊗[R] B
a b : A ⊗[R] B
x' : ↥(Submodule.restrictScalars R I) ⊗[R] B
ha' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x' =
    a • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
y' : ↥(Submodule.restrictScalars R I) ⊗[R] B
hb' :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) y' =
    b • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x
⊢ (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) (x' + y') =
    (a + b) • (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I))) x

Next tactic:
simp only [map_add, ha', add_smul, hb']