awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
x_1 : A ⊗[R] B
hx :
  x_1 ∈
    (↑(Submodule.restrictScalars R (R := A ⊗[R] B)
          (Submodule.span (A ⊗[R] B) ((⇑includeLeft : (a : A) → A ⊗[R] B) '' (↑I : Set A)))) :
      Set (A ⊗[R] B))
a : A ⊗[R] B
x : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B
a₁ :
  ∃ (y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B),
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y =
      HSMul.hSMul (α := A ⊗[R] B) (β := A ⊗[R] B) 0
        ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
              (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
            x :
          A ⊗[R] B)
⊢ ∃ (y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B),
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y =
      HSMul.hSMul (β := A ⊗[R] B) a
        ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
              (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
            x :
          A ⊗[R] B)
have a₂ : ∀ (a : A) (b : B),
  ∃ (y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B),
    (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y =
      HSMul.hSMul (α := A ⊗[R] B) (β := A ⊗[R] B) (a ⊗ₜ[R] b)
        ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
              (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
            x :
          A ⊗[R] B)
Tactic: induction a with
      | zero =>
        use 0
        simp only [map_zero, smul_eq_mul, zero_mul]
      | tmul a b =>
        induction x with
        | zero =>
          use 0
          simp only [map_zero, smul_eq_mul, mul_zero]
        | tmul x y =>
          use (a • x) ⊗ₜ[R] (b * y)
          simp only [smul_eq_mul]
          with_unfolding_all 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'
        simp only [map_add, ha', add_smul, hb']
Cleared hypotheses: a
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
a : ↥(Submodule.restrictScalars R I)
b : B
⊢ Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        (a ⊗ₜ[R] b) :
      A ⊗[R] B)
have a₁ : (↑a : A) ⊗ₜ[R] b ∈ (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
Tactic: simp only [LinearMap.rTensor_tmul, Submodule.coe_subtype]
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
a : ↥(Submodule.restrictScalars R I)
b : B
this : (↑a : A) ⊗ₜ[R] b = HMul.hMul (α := A ⊗[R] B) (1 ⊗ₜ[R] b) ((↑a : A) ⊗ₜ[R] 1)
⊢ Membership.mem (γ := Submodule (A ⊗[R] B) (A ⊗[R] B)) (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I) ((↑a : A) ⊗ₜ[R] b)
have rw : Membership.mem (γ := Submodule (A ⊗[R] B) (A ⊗[R] B)) (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)
  (HMul.hMul (α := A ⊗[R] B) (1 ⊗ₜ[R] b) ((↑a : A) ⊗ₜ[R] 1))
Tactic: rw [this]
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
a : ↥(Submodule.restrictScalars R I)
b : B
this : (↑a : A) ⊗ₜ[R] b = HMul.hMul (α := A ⊗[R] B) (1 ⊗ₜ[R] b) ((↑a : A) ⊗ₜ[R] 1)
⊢ Membership.mem (γ := Submodule (A ⊗[R] B) (A ⊗[R] B)) (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)
    (HMul.hMul (α := A ⊗[R] B) (1 ⊗ₜ[R] b) ((↑a : A) ⊗ₜ[R] 1))
have a₁ : Membership.mem (γ := Ideal (A ⊗[R] B)) (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I) ((↑a : A) ⊗ₜ[R] 1)
Tactic: apply Ideal.mul_mem_left
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
a : ↥(Submodule.restrictScalars R I)
b : B
this : (↑a : A) ⊗ₜ[R] b = HMul.hMul (α := A ⊗[R] B) (1 ⊗ₜ[R] b) ((↑a : A) ⊗ₜ[R] 1)
⊢ Membership.mem (γ := Ideal (A ⊗[R] B)) (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I) ((↑a : A) ⊗ₜ[R] 1)
have a₁ : (↑a : A) ∈ I
Tactic: apply Ideal.mem_map_of_mem includeLeft
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
a : ↥(Submodule.restrictScalars R I)
b : B
⊢ (↑a : A) ⊗ₜ[R] b ∈ (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
have a₁ : (↑a : A) ⊗ₜ[R] b = HMul.hMul (α := A ⊗[R] B) (1 ⊗ₜ[R] b) ((↑a : A) ⊗ₜ[R] 1)
Tactic: suffices (a : A) ⊗ₜ[R] b = ((1 : A) ⊗ₜ[R] b) * ((a : A) ⊗ₜ[R] (1 : B)) by
          simp only [Submodule.coe_restrictScalars, SetLike.mem_coe]
          rw [this]
          apply Ideal.mul_mem_left
          -- Note: adding `includeLeft` as a hint fixes a timeout https://github.com/leanprover-community/mathlib4/pull/8386
          apply Ideal.mem_map_of_mem includeLeft
          exact Submodule.coe_mem a
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
x y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B
hx :
  Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        x :
      A ⊗[R] B)
hy :
  Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y :
      A ⊗[R] B)
⊢ Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        (x + y) :
      A ⊗[R] B)
have a : HAdd.hAdd (α := A ⊗[R] B) (β := A ⊗[R] B)
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        x :
      A ⊗[R] B)
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y :
      A ⊗[R] B) ∈
  (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
Tactic: rw [map_add]
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B
⊢ Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y :
      A ⊗[R] B)
have a : (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
      (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
    0 ∈
  (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
Tactic: induction y with
    | zero =>
        rw [map_zero]
        apply zero_mem
    | tmul a b =>
        simp only [LinearMap.rTensor_tmul, Submodule.coe_subtype]
        suffices (a : A) ⊗ₜ[R] b = ((1 : A) ⊗ₜ[R] b) * ((a : A) ⊗ₜ[R] (1 : B)) by
          simp only [Submodule.coe_restrictScalars, SetLike.mem_coe]
          rw [this]
          apply Ideal.mul_mem_left
          -- Note: adding `includeLeft` as a hint fixes a timeout https://github.com/leanprover-community/mathlib4/pull/8386
          apply Ideal.mem_map_of_mem includeLeft
          exact Submodule.coe_mem a
        simp only [Algebra.TensorProduct.tmul_mul_tmul,
          mul_one, one_mul]
    | add x y hx hy =>
        rw [map_add]
        apply Submodule.add_mem _ hx hy
Cleared hypotheses: y
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B
a :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
        (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
      0 ∈
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
⊢ Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y :
      A ⊗[R] B)
have a₁ : ∀ (a : ↥(Submodule.restrictScalars R I)) (b : B),
  Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        (a ⊗ₜ[R] b) :
      A ⊗[R] B)
Tactic: induction y with
    | zero =>
        rw [map_zero]
        apply zero_mem
    | tmul a b =>
        simp only [LinearMap.rTensor_tmul, Submodule.coe_subtype]
        suffices (a : A) ⊗ₜ[R] b = ((1 : A) ⊗ₜ[R] b) * ((a : A) ⊗ₜ[R] (1 : B)) by
          simp only [Submodule.coe_restrictScalars, SetLike.mem_coe]
          rw [this]
          apply Ideal.mul_mem_left
          -- Note: adding `includeLeft` as a hint fixes a timeout https://github.com/leanprover-community/mathlib4/pull/8386
          apply Ideal.mem_map_of_mem includeLeft
          exact Submodule.coe_mem a
        simp only [Algebra.TensorProduct.tmul_mul_tmul,
          mul_one, one_mul]
    | add x y hx hy =>
        rw [map_add]
        apply Submodule.add_mem _ hx hy
Cleared hypotheses: y
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal A
y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B
a :
  (LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
        (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
      0 ∈
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
a₁ :
  ∀ (a : ↥(Submodule.restrictScalars R I)) (b : B),
    Membership.mem (α := A ⊗[R] B)
      (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
      ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
          (a ⊗ₜ[R] b) :
        A ⊗[R] B)
⊢ Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        y :
      A ⊗[R] B)
have a₂ : ∀ (x y : TensorProduct.{u_1, u_2, u_3} R (↥(Submodule.restrictScalars R I)) B)
  (hx :
    Membership.mem (α := A ⊗[R] B)
      (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
      ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
          x :
        A ⊗[R] B))
  (hy :
    Membership.mem (α := A ⊗[R] B)
      (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
      ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
          y :
        A ⊗[R] B)),
  Membership.mem (α := A ⊗[R] B)
    (↑(Submodule.restrictScalars R (map (F := A →ₐ[R] A ⊗[R] B) includeLeft I)) : Set (A ⊗[R] B))
    ((LinearMap.rTensor B (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : ↥(Submodule.restrictScalars R I) ⊗[R] B) → A ⊗[R] B)
        (x + y) :
      A ⊗[R] B)
Tactic: induction y with
    | zero =>
        rw [map_zero]
        apply zero_mem
    | tmul a b =>
        simp only [LinearMap.rTensor_tmul, Submodule.coe_subtype]
        suffices (a : A) ⊗ₜ[R] b = ((1 : A) ⊗ₜ[R] b) * ((a : A) ⊗ₜ[R] (1 : B)) by
          simp only [Submodule.coe_restrictScalars, SetLike.mem_coe]
          rw [this]
          apply Ideal.mul_mem_left
          -- Note: adding `includeLeft` as a hint fixes a timeout https://github.com/leanprover-community/mathlib4/pull/8386
          apply Ideal.mem_map_of_mem includeLeft
          exact Submodule.coe_mem a
        simp only [Algebra.TensorProduct.tmul_mul_tmul,
          mul_one, one_mul]
    | add x y hx hy =>
        rw [map_add]
        apply Submodule.add_mem _ hx hy
Cleared hypotheses: y
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
⊢ Eq (α := Submodule R (A ⊗[R] B)) (Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I))
    (LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
      (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I))))
have rw : (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B)) =
  (↑(LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
        (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)))) :
    Set (A ⊗[R] B))
Tactic: rw [← SetLike.coe_set_eq]
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
⊢ (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B)) =
    (↑(LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
          (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)))) :
      Set (A ⊗[R] B))
have a : (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B)) ≤
  (↑(LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
        (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)))) :
    Set (A ⊗[R] B))
Tactic: apply le_antisymm
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
a :
  (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B)) ≤
    (↑(LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
          (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)))) :
      Set (A ⊗[R] B))
⊢ (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B)) =
    (↑(LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
          (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)))) :
      Set (A ⊗[R] B))
have a₁ : (↑(LinearMap.range (M := TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I))
        (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)))) :
    Set (A ⊗[R] B)) ≤
  (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B))
Tactic: apply le_antisymm
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (hypothesis)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
x : A ⊗[R] B
hx : x ∈ (↑(Submodule.restrictScalars R (map (F := B →ₐ[R] A ⊗[R] B) includeRight I)) : Set (A ⊗[R] B))
⊢ ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
    (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
        y =
      x
have hx₁ : x ∈
  (↑(Submodule.restrictScalars R (R := A ⊗[R] B)
        (Submodule.span (A ⊗[R] B) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)))) :
    Set (A ⊗[R] B))
Tactic: rw [Ideal.map, ← submodule_span_eq] at hx
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
x : A ⊗[R] B
hx :
  x ∈
    (↑(Submodule.restrictScalars R (R := A ⊗[R] B)
          (Submodule.span (A ⊗[R] B) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)))) :
      Set (A ⊗[R] B))
⊢ ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
    (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
        y =
      x
have a : ∀ (x : A ⊗[R] B) (h : Membership.mem (γ := Set (A ⊗[R] B)) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)) x),
  ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
    (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
        y =
      x
Tactic: refine Submodule.span_induction ?_ ?_ ?_ ?_ hx
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
x : A ⊗[R] B
hx :
  x ∈
    (↑(Submodule.restrictScalars R (R := A ⊗[R] B)
          (Submodule.span (A ⊗[R] B) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)))) :
      Set (A ⊗[R] B))
a :
  ∀ (x : A ⊗[R] B) (h : Membership.mem (γ := Set (A ⊗[R] B)) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)) x),
    ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
      (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
          y =
        x
⊢ ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
    (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
        y =
      x
have a₁ : ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
  Eq (α := A ⊗[R] B)
    ((LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
        y :
      A ⊗[R] B)
    (0 : A ⊗[R] B)
Tactic: refine Submodule.span_induction ?_ ?_ ?_ ?_ hx
-- Lean 4 proof step from Mathlib.LinearAlgebra.TensorProduct.RightExactness (goal)
Goal:
R : Type u_1
inst : CommSemiring R
A : Type u_2
B : Type u_3
inst_1 : Semiring A
inst_2 : Semiring B
inst_3 : Algebra R A
inst_4 : Algebra R B
I : Ideal B
x : A ⊗[R] B
hx :
  x ∈
    (↑(Submodule.restrictScalars R (R := A ⊗[R] B)
          (Submodule.span (A ⊗[R] B) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)))) :
      Set (A ⊗[R] B))
a :
  ∀ (x : A ⊗[R] B) (h : Membership.mem (γ := Set (A ⊗[R] B)) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B)) x),
    ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
      (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
          y =
        x
a₁ :
  ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
    Eq (α := A ⊗[R] B)
      ((LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
          y :
        A ⊗[R] B)
      (0 : A ⊗[R] B)
⊢ ∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
    (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
          (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
        y =
      x
have a₂ : ∀ (x y : A ⊗[R] B)
  (hx :
    Membership.mem (γ := Submodule (A ⊗[R] B) (A ⊗[R] B))
      (Submodule.span (A ⊗[R] B) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B))) x)
  (hy :
    Membership.mem (γ := Submodule (A ⊗[R] B) (A ⊗[R] B))
      (Submodule.span (A ⊗[R] B) ((⇑includeRight : (a : B) → A ⊗[R] B) '' (↑I : Set B))) y),
  (∃ (y : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
      (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
            (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
          y =
        x) →
    (∃ (y_1 : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
        (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
              (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
            y_1 =
          y) →
      ∃ (y_1 : TensorProduct.{u_1, u_2, u_3} R A ↥(Submodule.restrictScalars R I)),
        (LinearMap.lTensor A (Submodule.subtype (Submodule.restrictScalars R I)) :
              (a : A ⊗[R] ↥(Submodule.restrictScalars R I)) → A ⊗[R] B)
            y_1 =
          x + y
Tactic: refine Submodule.span_induction ?_ ?_ ?_ ?_ hx