-- Mathlib/RingTheory/TensorProduct/Nontrivial.lean
theorem nontrivial_of_algebraMap_injective_of_isDomain
    (R A B : Type*) [CommRing R] [CommRing A] [CommRing B] [Algebra R A] [Algebra R B]
    (ha : Function.Injective (algebraMap R A)) (hb : Function.Injective (algebraMap R B))
    [IsDomain A] [IsDomain B] : Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
⊢ Nontrivial (A ⊗[R] B)

Tactic:
let FB := FractionRing B

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
⊢ Nontrivial (A ⊗[R] B)

Tactic:
let FR := FractionRing R

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
⊢ Nontrivial (A ⊗[R] B)

Tactic:
let FA := FractionRing A

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
⊢ Nontrivial (A ⊗[R] B)

Tactic:
let fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom (g := Algebra.ofId R FA)
  ((IsFractionRing.injective A FA).comp ha)

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom ⋯
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
⊢ Nontrivial (A ⊗[R] B)

Tactic:
haveI := ha.isDomain _

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom ⋯
⊢ Nontrivial (A ⊗[R] B)

Tactic:
let fb : FR →ₐ[R] FB := IsFractionRing.liftAlgHom (g := Algebra.ofId R FB)
  ((IsFractionRing.injective B FB).comp hb)

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom ⋯
fb : FR →ₐ[R] FB := IsFractionRing.liftAlgHom ⋯
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom ⋯
fb : FR →ₐ[R] FB := IsFractionRing.liftAlgHom ⋯
⊢ Nontrivial (A ⊗[R] B)

Tactic:
algebraize_only [fa.toRingHom, fb.toRingHom]

Result:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom ⋯
fb : FR →ₐ[R] FB := IsFractionRing.liftAlgHom ⋯
algInst✝¹ : Algebra FR FA := fa.toAlgebra
algInst✝ : Algebra FR FB := fb.toAlgebra
⊢ Nontrivial (A ⊗[R] B)

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing B
inst✝³ : Algebra R A
inst✝² : Algebra R B
ha : Function.Injective ⇑(algebraMap R A)
hb : Function.Injective ⇑(algebraMap R B)
inst✝¹ : IsDomain A
inst✝ : IsDomain B
this : IsDomain R
FR : Type u_1 := FractionRing R
FA : Type u_2 := FractionRing A
FB : Type u_3 := FractionRing B
fa : FR →ₐ[R] FA := IsFractionRing.liftAlgHom ⋯
fb : FR →ₐ[R] FB := IsFractionRing.liftAlgHom ⋯
algInst✝¹ : Algebra FR FA := fa.toAlgebra
algInst✝ : Algebra FR FB := fb.toAlgebra
⊢ Nontrivial (A ⊗[R] B)

Tactic:
exact Algebra.TensorProduct.mapOfCompatibleSMul FR R FA FB |>.comp
  (Algebra.TensorProduct.map (IsScalarTower.toAlgHom R A FA) (IsScalarTower.toAlgHom R B FB))
  |>.toRingHom.domain_nontrivial

Result:
no goals