X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2Falgebra%2Fsemigroups.ma;h=5b461d1a4f43edba6acc9e4dd448f0eceb157243;hb=a7063fc0997a9d9eae6c329443e67ab92c4b6a0f;hp=93a139ca760e5113f6b87d00a8f09d5552861e48;hpb=ceb1ffa3c01551ba51c1afcd85d693726c7fd3d9;p=helm.git diff --git a/helm/matita/library/algebra/semigroups.ma b/helm/matita/library/algebra/semigroups.ma index 93a139ca7..5b461d1a4 100644 --- a/helm/matita/library/algebra/semigroups.ma +++ b/helm/matita/library/algebra/semigroups.ma @@ -16,38 +16,49 @@ set "baseuri" "cic:/matita/algebra/semigroups". include "higher_order_defs/functions.ma". -definition isSemiGroup ≝ - λC:Type. λop: C → C → C.associative C op. +(* Magmas *) -record SemiGroup : Type ≝ - { carrier: Type; - op: carrier → carrier → carrier; - properties: isSemiGroup carrier op +record Magma : Type ≝ + { carrier:> Type; + op: carrier → carrier → carrier }. - -coercion cic:/matita/algebra/semigroups/carrier.con. -notation "hvbox(a break * \sub S b)" +notation < "M" for @{ 'carrier $M }. +interpretation "carrier coercion" 'carrier S = + (cic:/matita/algebra/semigroups/carrier.con S). + +notation "hvbox(a break \middot b)" left associative with precedence 55 -for @{ 'ptimes $S $a $b }. +for @{ 'magma_op $a $b }. -interpretation "Semigroup operation" 'times a b = +interpretation "magma operation" 'magma_op a b = (cic:/matita/algebra/semigroups/op.con _ a b). -interpretation "Semigroup operation" 'ptimes S a b = - (cic:/matita/algebra/semigroups/op.con S a b). +(* Semigroups *) + +record isSemiGroup (M:Magma) : Prop ≝ + { associative: associative ? (op M) }. +record SemiGroup : Type ≝ + { magma:> Magma; + semigroup_properties:> isSemiGroup magma + }. + +notation < "S" for @{ 'magma $S }. +interpretation "magma coercion" 'magma S = + (cic:/matita/algebra/semigroups/magma.con S). + definition is_left_unit ≝ - λS:SemiGroup. λe:S. ∀x:S. e * x = x. + λS:SemiGroup. λe:S. ∀x:S. e·x = x. definition is_right_unit ≝ - λS:SemiGroup. λe:S. ∀x:S. x * e = x. + λS:SemiGroup. λe:S. ∀x:S. x·e = x. theorem is_left_unit_to_is_right_unit_to_eq: - ∀S:SemiGroup. ∀e1,e2:S. - is_left_unit ? e1 → is_right_unit ? e2 → e1=e2. + ∀S:SemiGroup. ∀e,e':S. + is_left_unit ? e → is_right_unit ? e' → e=e'. intros; - rewrite < (H e2); - rewrite < (H1 e1) in \vdash (? ? % ?); + rewrite < (H e'); + rewrite < (H1 e) in \vdash (? ? % ?); reflexivity. -qed. \ No newline at end of file +qed.