Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(algebra/star/*): Allow for star operation on non-associative algebras #17949

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
29f4a0c
Remove requirement for star multiplication to be associative
mans0954 Dec 8, 2022
18e5bce
Non-associative star pi
mans0954 Dec 8, 2022
ffee03b
Non-assoc self-adjoint
mans0954 Dec 8, 2022
42dc59e
Try to get it building
mans0954 Dec 9, 2022
df84735
instance star_ring.to_star_add_monoid
mans0954 Dec 10, 2022
e4d931f
instance star_ring.to_star_add_monoid 100 and instance star_ring.to_s…
mans0954 Dec 10, 2022
16e8fdf
instance star_ring.to_star_add_monoid 90 and instance star_ring.to_st…
mans0954 Dec 10, 2022
d40bdb0
instance _root_.function.star_module
mans0954 Dec 11, 2022
299cf47
Merge branch 'master' into non-assoc-star-mul
mans0954 Dec 14, 2022
84933b9
Restore proof
mans0954 Dec 15, 2022
84da9f3
Merge branch 'master' into non-assoc-star-mul
mans0954 Dec 15, 2022
c9e8f9c
Update src/algebra/star/pi.lean
mans0954 Dec 15, 2022
af420de
usual pi instance not firing disclaimer
mans0954 Dec 15, 2022
51acd68
Fix example
mans0954 Dec 16, 2022
9e6803a
Merge branch 'master' into non-assoc-star-mul
mans0954 Jan 7, 2023
56f4773
Take coe_pow out of simp
mans0954 Jan 7, 2023
ca9d6c5
rename star_semigroup star_magma
mans0954 Jan 8, 2023
8f37a75
Merge branch 'master' into non-assoc-star-mul
mans0954 Jan 8, 2023
a326be0
prod
mans0954 Jan 9, 2023
8559231
Update src/topology/continuous_function/algebra.lean
mans0954 Jan 10, 2023
228057f
Merge branch 'master' into non-assoc-star-mul
mans0954 Jan 10, 2023
a7caf10
relax
mans0954 Jan 10, 2023
83c1cbe
Merge branch 'master' into non-assoc-star-mul
mans0954 Jan 16, 2023
f00d5bc
Merge branch 'master' into non-assoc-star-mul
mans0954 Jan 17, 2023
ed8d545
Merge branch 'master' into non-assoc-star-mul
mans0954 Jan 18, 2023
d90677a
Replace star_magma with star_mul
mans0954 Jan 18, 2023
6974bb9
unify additive and multiplicative versions
YaelDillies Feb 6, 2023
4b9b1a9
Merge remote-tracking branch 'origin/master' into non-assoc-star-mul
YaelDillies Feb 6, 2023
da00e28
fix a few more
YaelDillies Feb 17, 2023
47e03b3
fix algebra.star.pi, algebra.star.prod
YaelDillies Feb 17, 2023
4dcf61c
fix algebra.star.pointwise
YaelDillies Feb 17, 2023
ea32649
fix algebra.star.self_adjoint
YaelDillies Feb 18, 2023
168ed0b
Merge branch 'master' into non-assoc-star-mul
mans0954 Feb 18, 2023
c44643f
fix algebra.algebra.unitization
YaelDillies Feb 19, 2023
c6513a2
fix data.matric.basic
YaelDillies Feb 20, 2023
5608f6b
Merge branch 'master' into non-assoc-star-mul
mans0954 Apr 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/algebra/algebra/unitization.lean
Expand Up @@ -408,8 +408,7 @@ instance [comm_semiring R] [star_ring R] [add_comm_monoid A] [star_add_monoid A]
{ star_smul := λ r x, ext (by simp) (by simp) }

instance [comm_semiring R] [star_ring R] [non_unital_semiring A] [star_ring A]
[module R A] [is_scalar_tower R A A] [smul_comm_class R A A] [star_module R A] :
star_ring (unitization R A) :=
[module R A] [star_module R A] : star_ring (unitization R A) :=
{ star_mul := λ x y, ext (by simp [star_mul])
(by simp [star_mul, add_comm (star x.fst • star y.snd)]),
..unitization.star_add_monoid }
Expand Down
8 changes: 4 additions & 4 deletions src/algebra/star/basic.lean
Expand Up @@ -117,7 +117,7 @@ attribute [simp] star_trivial
A `*`-semigroup is a semigroup `R` with an involutive operations `star`
so `star (r * s) = star s * star r`.
-/
class star_semigroup (R : Type u) [semigroup R] extends has_involutive_star R :=
class star_semigroup (R : Type u) [has_mul R] extends has_involutive_star R :=
(star_mul : ∀ r s : R, star (r * s) = star s * star r)

export star_semigroup (star_mul)
Expand Down Expand Up @@ -236,12 +236,12 @@ A `*`-ring `R` is a (semi)ring with an involutive `star` operation which is addi
which makes `R` with its multiplicative structure into a `*`-semigroup
(i.e. `star (r * s) = star s * star r`).
-/
class star_ring (R : Type u) [non_unital_semiring R] extends star_semigroup R :=
class star_ring (R : Type u) [non_unital_non_assoc_semiring R] extends star_semigroup R :=
(star_add : ∀ r s : R, star (r + s) = star r + star s)

@[priority 100]
instance star_ring.to_star_add_monoid [non_unital_semiring R] [star_ring R] : star_add_monoid R :=
{ star_add := star_ring.star_add }
instance star_ring.to_star_add_monoid [non_unital_non_assoc_semiring R] [star_ring R] :
star_add_monoid R := { star_add := star_ring.star_add }

/-- `star` as an `ring_equiv` from `R` to `Rᵐᵒᵖ` -/
@[simps apply]
Expand Down
8 changes: 6 additions & 2 deletions src/algebra/star/pi.lean
Expand Up @@ -29,13 +29,13 @@ lemma star_def [Π i, has_star (f i)] (x : Π i, f i) : star x = λ i, star (x i
instance [Π i, has_involutive_star (f i)] : has_involutive_star (Π i, f i) :=
{ star_involutive := λ _, funext $ λ _, star_star _ }

instance [Π i, semigroup (f i)] [Π i, star_semigroup (f i)] : star_semigroup (Π i, f i) :=
instance [Π i, has_mul (f i)] [Π i, star_semigroup (f i)] : star_semigroup (Π i, f i) :=
{ star_mul := λ _ _, funext $ λ _, star_mul _ _ }

instance [Π i, add_monoid (f i)] [Π i, star_add_monoid (f i)] : star_add_monoid (Π i, f i) :=
{ star_add := λ _ _, funext $ λ _, star_add _ _ }

instance [Π i, non_unital_semiring (f i)] [Π i, star_ring (f i)] : star_ring (Π i, f i) :=
instance [Π i, non_unital_non_assoc_semiring (f i)] [Π i, star_ring (f i)] : star_ring (Π i, f i) :=
{ ..pi.star_add_monoid, ..(pi.star_semigroup : star_semigroup (Π i, f i)) }

instance {R : Type w}
Expand All @@ -62,3 +62,7 @@ lemma star_sum_elim {I J α : Type*} (x : I → α) (y : J → α) [has_star α]
by { ext x, cases x; simp }

end function

instance _root_.function.star_module (α β : Type*) [has_star α] [has_star β] [has_smul α β]
mans0954 marked this conversation as resolved.
Show resolved Hide resolved
[star_module α β] : star_module α (I → β) :=
mans0954 marked this conversation as resolved.
Show resolved Hide resolved
pi.star_module
12 changes: 9 additions & 3 deletions src/algebra/star/self_adjoint.lean
Expand Up @@ -6,6 +6,7 @@ Authors: Frédéric Dupuis

import algebra.star.basic
import group_theory.subgroup.basic
import algebra.star.pi

/-!
# Self-adjoint, skew-adjoint and normal elements of a star additive group
Expand Down Expand Up @@ -63,11 +64,11 @@ lemma star_iff [has_involutive_star R] {x : R} : is_self_adjoint (star x) ↔ is
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) :=
lemma star_mul_self [has_mul R] [star_semigroup R] (x : R) : is_self_adjoint (star x * x) :=
by simp only [is_self_adjoint, star_mul, star_star]

@[simp]
lemma mul_star_self [semigroup R] [star_semigroup R] (x : R) : is_self_adjoint (x * star x) :=
lemma mul_star_self [has_mul R] [star_semigroup R] (x : R) : is_self_adjoint (x * star x) :=
by simpa only [star_star] using star_mul_self (star x)

/-- Functions in a `star_hom_class` preserve self-adjoint elements. -/
Expand Down Expand Up @@ -274,7 +275,12 @@ instance : has_rat_cast (self_adjoint R) :=
rfl

instance has_qsmul : has_smul ℚ (self_adjoint R) :=
⟨λ a x, ⟨a • x, by rw rat.smul_def; exact (rat_cast_mem a).mul x.prop⟩⟩
⟨λ a x, ⟨a • x, by rw rat.smul_def;
begin
apply is_self_adjoint.mul,
exact rat_cast_mem a,
exact x.prop,
end ⟩ ⟩
mans0954 marked this conversation as resolved.
Show resolved Hide resolved

@[simp, norm_cast] lemma coe_rat_smul (x : self_adjoint R) (a : ℚ) : ↑(a • x) = a • (x : R) :=
rfl
Expand Down