Theorem: RingHom.surjective_stableUnderBaseChange
File: Mathlib/RingTheory/RingHom/Surjective.lean

tactic: refine StableUnderBaseChange.mk _ surjective_respectsIso ?_
state_before: ⊢ StableUnderBaseChange fun {X Y} [CommRing X] [CommRing Y] f => Function.Surjective ⇑f
state_after: ⊢ ∀ ⦃R S T : Type u_1⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], Function.Surjective ⇑(algebraMap R T) → Function.Surjective ⇑includeLeftRingHom

tactic: classical
introv h x
induction x with
| zero => exact ⟨0, map_zero _⟩
| tmul x y =>
  obtain ⟨y, rfl⟩ := h y; use y • x; dsimp
  rw [TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one]
| add x y ex ey => obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := ex, ey; exact ⟨x + y, map_add _ x y⟩
state_before: ⊢ ∀ ⦃R S T : Type u_1⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], Function.Surjective ⇑(algebraMap R T) → Function.Surjective ⇑includeLeftRingHom
state_after: no goals

tactic: introv h x
state_before: ⊢ ∀ ⦃R S T : Type u_1⦄ [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] [inst_3 : Algebra R S]
    [inst_4 : Algebra R T], Function.Surjective ⇑(algebraMap R T) → Function.Surjective ⇑includeLeftRingHom
state_after: R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S ⊗[R] T
⊢ ∃ a, includeLeftRingHom a = x

tactic: induction x with
| zero => exact ⟨0, map_zero _⟩
| tmul x y =>
  obtain ⟨y, rfl⟩ := h y; use y • x; dsimp
  rw [TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one]
| add x y ex ey => obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := ex, ey; exact ⟨x + y, map_add _ x y⟩
state_before: R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S ⊗[R] T
⊢ ∃ a, includeLeftRingHom a = x
state_after: no goals

tactic: exact ⟨0, map_zero _⟩
state_before: case zero
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
⊢ ∃ a, includeLeftRingHom a = 0
state_after: no goals

tactic: obtain ⟨y, rfl⟩ := h y
state_before: case tmul
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : T
⊢ ∃ a, includeLeftRingHom a = x ⊗ₜ[R] y
state_after: case tmul.intro
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : R
⊢ ∃ a, includeLeftRingHom a = x ⊗ₜ[R] (algebraMap R T) y

tactic: use y • x
state_before: case tmul.intro
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : R
⊢ ∃ a, includeLeftRingHom a = x ⊗ₜ[R] (algebraMap R T) y
state_after: case h
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : R
⊢ includeLeftRingHom (y • x) = x ⊗ₜ[R] (algebraMap R T) y

tactic: dsimp
state_before: case h
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : R
⊢ includeLeftRingHom (y • x) = x ⊗ₜ[R] (algebraMap R T) y
state_after: case h
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : R
⊢ (y • x) ⊗ₜ[R] 1 = x ⊗ₜ[R] (algebraMap R T) y

tactic: rw [TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one]
state_before: case h
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x : S
y : R
⊢ (y • x) ⊗ₜ[R] 1 = x ⊗ₜ[R] (algebraMap R T) y
state_after: no goals

tactic: obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := ex, ey
state_before: case add
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x y : S ⊗[R] T
ex : ∃ a, includeLeftRingHom a = x
ey : ∃ a, includeLeftRingHom a = y
⊢ ∃ a, includeLeftRingHom a = x + y
state_after: case add.intro.intro
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x y : S
⊢ ∃ a, includeLeftRingHom a = includeLeftRingHom x + includeLeftRingHom y

tactic: exact ⟨x + y, map_add _ x y⟩
state_before: case add.intro.intro
R S T : Type u_1
inst✝⁴ : CommRing R
inst✝³ : CommRing S
inst✝² : CommRing T
inst✝¹ : Algebra R S
inst✝ : Algebra R T
h : Function.Surjective ⇑(algebraMap R T)
x y : S
⊢ ∃ a, includeLeftRingHom a = includeLeftRingHom x + includeLeftRingHom y
state_after: no goals