include "sets/sets.ma".
nrecord magma_type : Type[1] ≝
- { mcarr:> setoid;
- op: mcarr → mcarr → mcarr
+ { mtcarr:> setoid;
+ op: binary_morphism mtcarr mtcarr mtcarr
}.
nrecord magma (A: magma_type) : Type[1] ≝
{ mcarr:> powerset_setoid1 A;
op_closed: ∀x,y. x ∈ mcarr → y ∈ mcarr → op A x y ∈ mcarr
}.
-
-nrecord magma_morphism_type (A,B: magma_type) : Type ≝
- { mmcarr:1> A → B;
- mmprop: ∀x,y. mmcarr (op … x y) = op … (mmcarr x) (mmcarr y)
+(* le coercion non vanno; sospetto setoid1_of_setoid *)
+nrecord magma_morphism_type (A,B: magma_type) : Type[0] ≝
+ { mmcarr:> unary_morphism A B;
+ mmprop: ∀x,y:carr A. mmcarr (op ? x y) = op … (mmcarr x) (mmcarr y)
}.
-
-nrecord magma_morphism (A) (B) (Ma: magma A) (Mb: magma B) : Type ≝
+(* le coercion non vanno *)
+nrecord magma_morphism (A) (B) (Ma: magma A) (Mb: magma B) : Type[0] ≝
{ mmmcarr:> magma_morphism_type A B;
- mmclosed: ∀x. x ∈ Ma → mmmcarr x ∈ Mb
+ mmclosed: ∀x:carr A. x ∈ mcarr ? Ma → mmmcarr x ∈ mcarr ? Mb
}.
-
-ndefinition image: ∀A,B. (A → B) → Ω \sup A → Ω \sup B ≝
- λA,B,f,Sa. {y | ∃x. x ∈ Sa ∧ f x = y}.
+(*
+(* qui non funziona una cippa *)
+ndefinition image: ∀A,B. (carr A → carr B) → Ω \sup A → Ω \sup B ≝
+ λA,B:setoid.λf:carr A → carr B.λSa:Ω \sup A.
+ {y | ∃x. x ∈ Sa ∧ eq_rel (carr B) (eq B) ? ?(*(f x) y*)}.
+ ##[##2: napply (f x); ##|##3: napply y]
+ #a; #a'; #H; nwhd; nnormalize; (* per togliere setoid1_of_setoid *) napply (mk_iff ????);
+ *; #x; #Hx; napply (ex_intro … x)
+ [ napply (. (#‡(#‡#)));
ndefinition mm_image:
∀A,B. ∀Ma: magma A. ∀Mb: magma B. magma_morphism … Ma Mb → magma B.
[ napply (M1 ∩ M2)
| #x; #y; nwhd in ⊢ (% → % → %); *; #Hx1; #Hx2; *; #Hy1; #Hy2;
napply conj; napply op_closed; nassumption ]
-nqed.
\ No newline at end of file
+nqed.
+*)
\ No newline at end of file