1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/test/".
17 include "logic/equality.ma".
19 record R1 : Type := { C:> Type; plus: C \to C \to C}.
20 record R2 : Type := { K:> Type; mult: K \to K \to K}.
22 (* Missing syntactic sugar:
23 record R : Type := { r1 :> R1; r2 :> R2 with C r1 = K r2}
25 record R : Type := { r1 :> R1; r2_ : R2; with_: C r1 = K r2_ }.
27 (* This can be done automatically *)
32 | apply (eq_rect ? ? (λx.x → x → x));
38 | apply (mult (r2_ r))
42 coercion cic:/matita/test/r2.con.
44 (* Let's play with it *)
45 definition f ≝ λr:R.λx:r.plus ? (mult ? x x) x.
47 axiom plus_idempotent: ∀r1:R1.∀x:r1. plus ? x x = x.
48 axiom mult_idempotent: ∀r2:R2.∀x:r2. mult ? x x = x.
50 lemma test: ∀r:R. ∀x:r. f ? x = x.