include "sets/sets.ma".
nrecord pre_magma : Type[1] ≝
- { carr: Type;
+ { carr:> Type;
op: carr → carr → carr
}.
-ncoercion carr: ∀M:pre_magma. Type ≝ carr on _M: pre_magma to Type.
nrecord magma (A: pre_magma) : Type[1] ≝
- { mcarr: Ω \sup A;
+ { mcarr:> Ω \sup A;
op_closed: ∀x,y. x ∈ mcarr → y ∈ mcarr → op A x y ∈ mcarr
}.
-ncoercion mcarr: ∀A.∀M: magma A. Ω \sup A ≝ mcarr
- on _M: magma ? to Ω \sup ?.
nrecord pre_magma_morphism (A,B: pre_magma) : Type ≝
- { mmcarr: A → B;
+ { mmcarr:1> A → B;
mmprop: ∀x,y. mmcarr (op ? x y) = op ? (mmcarr x) (mmcarr y)
}.
-ncoercion mmcarr: ∀A,B.∀M: pre_magma_morphism A B. A → B ≝ mmcarr
- on _M: pre_magma_morphism ? ? to ∀_.?.
nrecord magma_morphism (A) (B) (Ma: magma A) (Mb: magma B) : Type ≝
- { mmmcarr: pre_magma_morphism A B;
+ { mmmcarr:> pre_magma_morphism A B;
mmclosed: ∀x. x ∈ Ma → mmmcarr x ∈ Mb
}.
-ncoercion mmmcarr : ∀A,B,Ma,Mb.∀f: magma_morphism A B Ma Mb. pre_magma_morphism A B
- ≝ mmmcarr
- on _f: magma_morphism ???? to pre_magma_morphism ??.
ndefinition sub_magma ≝
λA.λM1,M2: magma A. M1 ⊆ M2.