Skip to content

Commit

Permalink
feat(algebra/algebra/basic) : add ring_hom.equiv_rat_alg_hom (#14772)
Browse files Browse the repository at this point in the history
Proves the equivalence between `ring_hom` and `rat_alg_hom`.

From flt-regular

Co-authored-by: Alex J. Best <alex.j.best@gmail.com>



Co-authored-by: Xavier-François Roblot <46200072+xroblot@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
  • Loading branch information
3 people committed Jun 17, 2022
1 parent 260d472 commit e23de85
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/algebra/algebra/basic.lean
Expand Up @@ -1291,13 +1291,39 @@ def to_int_alg_hom [ring R] [ring S] [algebra ℤ R] [algebra ℤ S] (f : R →+
(f : R →+* S) (r : ℚ) : f (algebra_map ℚ R r) = algebra_map ℚ S r :=
ring_hom.ext_iff.1 (subsingleton.elim (f.comp (algebra_map ℚ R)) (algebra_map ℚ S)) r

/-- Reinterpret a `ring_hom` as a `ℚ`-algebra homomorphism. -/
/-- Reinterpret a `ring_hom` as a `ℚ`-algebra homomorphism. This actually yields an equivalence,
see `ring_hom.equiv_rat_alg_hom`. -/
def to_rat_alg_hom [ring R] [ring S] [algebra ℚ R] [algebra ℚ S] (f : R →+* S) :
R →ₐ[ℚ] S :=
{ commutes' := f.map_rat_algebra_map, .. f }

@[simp]
lemma to_rat_alg_hom_to_ring_hom [ring R] [ring S] [algebra ℚ R] [algebra ℚ S]
(f : R →+* S) : ↑f.to_rat_alg_hom = f :=
ring_hom.ext $ λ x, rfl

end ring_hom

section

variables {R S : Type*}

@[simp]
lemma alg_hom.to_ring_hom_to_rat_alg_hom [ring R] [ring S] [algebra ℚ R] [algebra ℚ S]
(f : R →ₐ[ℚ] S) : (f : R →+* S).to_rat_alg_hom = f :=
alg_hom.ext $ λ x, rfl

/-- The equivalence between `ring_hom` and `ℚ`-algebra homomorphisms. -/
@[simps]
def ring_hom.equiv_rat_alg_hom [ring R] [ring S] [algebra ℚ R] [algebra ℚ S] :
(R →+* S) ≃ (R →ₐ[ℚ] S) :=
{ to_fun := ring_hom.to_rat_alg_hom,
inv_fun := alg_hom.to_ring_hom,
left_inv := ring_hom.to_rat_alg_hom_to_ring_hom,
right_inv := alg_hom.to_ring_hom_to_rat_alg_hom, }

end

section rat

instance algebra_rat {α} [division_ring α] [char_zero α] : algebra ℚ α :=
Expand Down

0 comments on commit e23de85

Please sign in to comment.