The equality relation on a type, written s=t in T or s=Tt, defines the element's referential nature. The semantic models we use in section take a type to be a partial equivalence relation (per)partial equivalence relation (per) on a collection of terms.
Given a type T, other types can be defined from it by specifying new equality
relations on the elements of T. For example, given the integers
,
we can define the congruence integers
to be the
type whose elements are those of
related by
is a type iff A is a type and E is an equivalence relation on A |
in by |
in A |
in B by quotientL |
in B |
in B |
For P to be a propositional function on a type A, we require that when a=a' in A then P(a) and P(a') are the same proposition. If we consider atomic propositions P(x) iff x=t in , then a=t in . The rules for equality of expressions built from elements of will guarantee the functional nature of propositions over . We discuss the topic in detail in section and in the literature on Nuprl [28,3].
The quotient type is very important in many subjects. We have found it especially natural in automata theory ([32]), rational arithmetic and of course, for congruences. For congruence integers we have proved Fermat's little theorem in this form:Fermat's little theorem
Here the display mechanism suppresses the type on equality when it can be immediately inferred from the type of the equands.