Skip to content

Commit

Permalink
feat(algebra/star/basic): add ring_hom.has_involutive_star (#17904)
Browse files Browse the repository at this point in the history
Define an instance `has_involutive_star` for ring homorphisms into a `star_ring`.
  • Loading branch information
xroblot committed Dec 14, 2022
1 parent aba57d4 commit daf8adf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/algebra/star/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,18 @@ lemma star_ring_end_apply [comm_semiring R] [star_ring R] {x : R} :
@[simp] lemma star_ring_end_self_apply [comm_semiring R] [star_ring R] (x : R) :
star_ring_end R (star_ring_end R x) = x := star_star x

instance ring_hom.has_involutive_star {S : Type u} [non_assoc_semiring S] [comm_semiring R]
[star_ring R] : has_involutive_star (S →+* R) :=
{ to_has_star := { star := λ f, ring_hom.comp (star_ring_end R) f },
star_involutive :=
by { intro _, ext, simp only [ring_hom.coe_comp, function.comp_app, star_ring_end_self_apply] }}

lemma ring_hom.star_def {S : Type u} [non_assoc_semiring S] [comm_semiring R] [star_ring R]
(f : S →+* R) : has_star.star f = ring_hom.comp (star_ring_end R) f := rfl

lemma ring_hom.star_apply {S : Type u} [non_assoc_semiring S] [comm_semiring R] [star_ring R]
(f : S →+* R) (s : S) : star f s = star (f s) := rfl

-- A more convenient name for complex conjugation
alias star_ring_end_self_apply ← complex.conj_conj
alias star_ring_end_self_apply ← is_R_or_C.conj_conj
Expand Down
4 changes: 4 additions & 0 deletions src/algebra/star/self_adjoint.lean
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ lemma star_eq [has_star R] {x : R} (hx : is_self_adjoint x) : star x = x := hx

lemma _root_.is_self_adjoint_iff [has_star R] {x : R} : is_self_adjoint x ↔ star x = x := iff.rfl

@[simp]
lemma star_iff [has_involutive_star R] {x : R} : is_self_adjoint (star x) ↔ is_self_adjoint x :=
by simpa only [is_self_adjoint, star_star] using eq_comm

@[simp]
lemma star_mul_self [semigroup R] [star_semigroup R] (x : R) : is_self_adjoint (star x * x) :=
by simp only [is_self_adjoint, star_mul, star_star]
Expand Down

0 comments on commit daf8adf

Please sign in to comment.