Return-Path: <John.Harrison-request@cl.cam.ac.uk>
Delivery-Date: 
Received: from leopard.cs.byu.edu (no rfc931) by swan.cl.cam.ac.uk 
          with SMTP (PP-6.5) outside ac.uk; Sat, 20 Nov 1993 15:25:27 +0000
Received: by leopard.cs.byu.edu (1.37.109.7/16.2) id AA15985;
          Sat, 20 Nov 93 08:03:13 -0700
Sender: info-hol-request@leopard.cs.byu.edu
Errors-To: info-hol-request@leopard.cs.byu.edu
Precedence: bulk
Received: from dworshak.cs.uidaho.edu by leopard.cs.byu.edu 
          with SMTP (1.37.109.7/16.2) id AA15981; Sat, 20 Nov 93 08:03:07 -0700
Received: from swan.cl.cam.ac.uk by dworshak.cs.uidaho.edu 
          with SMTP (1.37.109.4/16.2) id AA29503; Sat, 20 Nov 93 07:01:07 -0800
Received: from guillemot.cl.cam.ac.uk (user jrh (rfc931)) by swan.cl.cam.ac.uk 
          with SMTP (PP-6.5) to cl; Sat, 20 Nov 1993 15:00:59 +0000
To: info-hol@cs.uidaho.edu (hol mailing list)
Subject: Re: Help: how to define the following in HOL
In-Reply-To: Your message of "Fri, 19 Nov 93 15:57:30 +0100." <199311191457.AA11133@infix.cs.ruu.nl>
Date: Sat, 20 Nov 93 15:00:55 +0000
From: John Harrison <John.Harrison@cl.cam.ac.uk>
Message-Id: <"swan.cl.cam.:085500:931120150102"@cl.cam.ac.uk>


Wishnu says:

  I want to define a predicate that characterizes a class of function,
  say a class of indentity-like function. My informal idea is as
  follows:

      id is an IDENTITish function iff

      (id o f) o (id o g) = (f o g)

  how can I define the predicate INDENTITish in HOL?

You are proposing, I assume, a definition like this:

  IDENTish(id) = !f g. (id o f) o (id o g) = (f o g)

or

  IDENTish(id) = (!f. id o f = f) /\ (!g. g o id = g)

Unfortunately it's not possible to do it, because in a definition all type
variables free in the RHS must be free in the LHS. This is necessary to
preserve consistency given the implicit quantification over polymorphic types
at the *sequent* level.

You can of course define the following equivalent:

  IDENTish(id) = !x. id(x) = x

but if you are hoping to be able to make categorical-style definitions with
quantification over *all functions* you may as well forget it, as HOL stands at
the moment. However, being able to make such definitions would be part of the
wonderland opened up by adding explicit (local) type quantification to the HOL
logic as proposed by Tom Melham.

John.
