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 record group : Type β {
17 gmult : gcarr β gcarr β gcarr;
18 gopp : gcarr β gcarr;
22 interpretation "unif hints inverse" 'invert x = (gopp _ x).
23 interpretation "unif hing times" 'times x y = (gmult _ x y).
24 notation "π" non associative with precedence 90 for @{ 'unit }.
25 interpretation "unif hint unit" 'unit = (gunit _).
27 inductive Expr (g : group) : Type β
28 | Evar : gcarr g β Expr g
29 | Eopp : Expr g β Expr g
31 | Emult : Expr g β Expr g β Expr g.
33 let rec sem (g : group) (e : Expr g) on e : gcarr g β
36 | Eopp x β (sem g x) ^ -1
38 | Emult x y β (sem g x) * (sem g y)].
40 notation "γxγ" non associative with precedence 90 for @{ 'sem $x }.
41 interpretation "unif hint sem" 'sem x = (sem _ x).
43 axiom P : βg:group. gcarr g β Prop.
44 axiom tac : βg:group. Expr g β Expr g.
45 axiom start : βg,x.P g γxγ β Prop.
48 include "logic/equality.ma".
50 notation "@ t" non associative with precedence 90 for @{ (Ξ»x.x) $t }.
52 unification hint (βg:group.βx:g. γEvar ? xγ = x).
53 unification hint (βg:group.βx. γEopp g xγ = (@γxγ) ^-1).
54 unification hint (βg:group.βx,y. γEmult g x yγ = (@γxγ) * (@γyγ)).
56 lemma test : βg:group.βx,y:g. βh:P ? (x * (x^-1 * y)). start g ? h.
60 βx,Ξ. [| B 0, x::Ξ |] = x
61 βn,y,Ξ. [| B n, Ξ |] = [| B (S n), y::Ξ |]
62 βe,f. [| Add e f, Ξ |] = [| e, Ξ |] + [| f, Ξ |]
71 x = [| ?4, y::x::?3 |]
73 [| ?4, x::?3 |] =?= [| B (S ?n), ?y::?Ξ |]