Pers
Definition and
examples
CCC structure
Model of System
F
Partial Equivalence Relations
Samuel Pilon
Department of Mathematics and Statistics
University of Ottawa
April 6, 2017
Pers
Topics
Definition and
examples
CCC structure
Model of System
F
1 Definition and examples
2 CCC structure
3 Model of System F
Also presenting the Kleene first model
Pers
Definition of Pers
Definition and
examples
CCC structure
Model of System
F
Definition
A partial equivalence relation on a set A, called a Per, is a
symmetric and transitive relation on A.
or
A Per R on A is an equivalence relation on a subset of A,
called DomR , with no elements related elsewhere.
The definitions are equivalent because, for a symmetric
transitive relation R,
aRb ) bRa ) aRa
Pers
Graphically
Definition and
examples
CCC structure
Model of System
F
R is an equivalence relation on DomR = {a 2 A | aRa}. We
can therefore form the quotient DomR /R = {[a]R | aRa}.
Pers
Examples
Definition and
examples
CCC structure
1
Model of System
F
Suppose f is a partial function on A.
For any x, y 2 A, define
xRy
i↵
f (x) #, f (y ) # and f (x) = f (y ).
Then R is a Per on A and DomR = {x 2 A | f (x) #}.
2
Let A be the set of infinite sequences (ai )i2N ✓ Q. We
define (xi )i2N ⇡ (yj )j2N i↵
lim |xi
i,j!1
yj | = 0.
Then ⇡ is a Per and (xi )i2N 2 Dom⇡ i↵ it is a
converging Cauchy sequence. So Dom⇡ /⇡ = R.
Pers
Definition and
examples
CCC structure
Model of System
F
3
”Let X and Y be sets equipped with equivalence
relations (or PERs) ⇡X , ⇡Y . For f , g : X ! Y , define
f ⇡ g to mean:
8x0 , x,
x0 ⇡X x1 ) f (x0 ) ⇡Y g (x1 )
then f ⇡ f means that f induces a well-defined function
of the quotients X / ⇡X ! Y / ⇡Y . Thus, the PER ⇡
caprtures both the idea of definedness on the quotients
and of two functions inducing the same function on the
quotient.”1
1
from https://en.wikipedia.org/wiki/Partial equivalence relation
Pers
Partial combinatorial algebra
Definition and
examples
CCC structure
Model of System
F
Definition
A partial combinatory algebra, called PCA, is a structure
(D, ’, K , S) with a set D, a partial binary operation ’ and
elements K , S 2 D such that for all x, y , z 2 D
(
(xz)(yz)
if (xz)(yz) #
Kxy = x
Sxy #
Sxyz =
undefined if (xz)(yz) "
Pers
Main example: Kleene first model
Definition and
examples
CCC structure
Model of System
F
Let ( m )m2N be an acceptable enumeration of all the partial
recursive functions.
We could also use the notation {m}(n) for m (n).
– To have an ”acceptable” enumeration we must have some
hypothesis, but this is not important for us.
If we define m’n = m (n), then ’ is a partial binary operation
on N. It is possible to find numbers K , S 2 N satisfying the
PCA requirements, so that (N, ’, K , S) is a PCA.
Therefore, when considering the Pers on N, it will be
possible to form a CCC with them.
Pers
Category
Definition and
examples
CCC structure
Model of System
F
For partial combinatory algebra A, we have the category
PER(A) where
• Objets: Pers on A
• Arrows: Cell-preserving map: for Pers R and S, a map
f : R ! S is essentially a representable map of
quotients f : DomR /R ! DomS /S, so an equivalence
class is sent on an other equivalence class, with
xRy ) f (x) #, f (y ) # & f (x) S f (y ).
Pers
Representability
Definition and
examples
CCC structure
Model of System
F
We will forget about the actual map of quotients, and use
the representability. For each map f , f is named by F 2 A
with
xRy ) F ’x #, F ’y # & F ’x S F ’y .
We also define F ⇠ G , meaning that they name the same
morphism, if
xRy ) F ’x #, G ’y # & F ’x S G ’y .
We can easily verify that we have composition, associativity
and identity.
Pers
Products
Definition and
examples
CCC structure
Model of System
F
• Terminal object: 1 = any Per that has an unique
equivalence class (for example: 1 = A ⇥ A).
It is then clear that, for any Per R and any map
F : R ! 1, F names a morphism because
aRb ) F ’a1F ’b.
Pers
Products
Definition and
examples
CCC structure
Model of System
F
• Assuming that A has a product structure, define that
a(R ⇥ S)b i↵ (⇡1 ’a)R(⇡1 ’b) and (⇡2 ’a)S(⇡2 ’b).
So now ⇡1 and ⇡2 are the projections. For F : T ! R
and G : T ! S we define < F , G > : T ! R ⇥ S with
< F , G >= ⇤x. < F ’x, G ’x >
(it exists by combinatorial completeness).
Proof that ⇡1 ’ < F , G > R F :
aTb ) F ’a R F ’b
&
G ’a S G ’b
) < F ’a, G ’a > (R ⇥ S) < F ’b, G ’b >
) ⇡1 < F ’a, G ’a > R ⇡1 < F ’b, G ’b >= F ’b.
Pers
Definition and
examples
CCC structure
Model of System
F
Function spaces
• Define x(T S )y i↵ 8z, w (zSw ) x’zTy ’w ),
so x, y : S ! T are equal morphisms.
• For a f : R ⇥ S ! T , we define f ⇤ (x)(z) = f (< x, z >)
with
F ⇤ = ⇤x.⇤z.F ’ < x, y >,
(exists by combinatorial completeness)
which gives the needed f ⇤ : R !
TS.
This is because
xRx & zSw
) < x, z > (R ⇥ S) < x, w >
) F < x, z > T F < x, w >
) (F ⇤ ’x)’z T (F ⇤ ’x)’w ,
so 8z, w (zSw ) (F ⇤ ’x)’zT (F ⇤ ’x)’w ).
Pers
Function spaces
Definition and
examples
CCC structure
Model of System
F
• The evaluation morphism is ev ’a = (⇡1 ’a)’(⇡2 ’a).
We have a(T S ⇥ S)b ) ev ’aT ev ’b as needed, because
⇡1 ’a(T S )⇡1 ’b
&
⇡2 ’a S ⇡2 ’b
) (⇡1 ’a)’(⇡2 ’a) T (⇡1 ’b)’(⇡2 ’b).
Pers
Definition and
examples
CCC structure
Model of System
F
Theorem
For any partial combinatory algebra A that has a product
structure (pairing and projections with the usual axioms),
PER(A) forms a CCC.
Pers
Details that the Kleene first model is a CCC
Definition and
examples
CCC structure
Model of System
F
Let ( m )m2N be an acceptable enumeration of all the partial
recursive functions. We define m’n = m (n), and have that
(N, ’, K , S) is a PCA.
For the pairing, we use the inverse of the bijection
J¯ : N ⇥ N ! N
that was defined in class, so we have
<, >= J¯ 1 : N ! N ⇥ N.
We can then use the normal pairings ⇡1 , ⇡2 : N ⇥ N ! N
and have the required properties of the product structure.
Pers
Details that the Kleene first model is a CCC
Definition and
examples
CCC structure
Model of System
F
On the Kleene first model, there is the following theorem:
Theorem (s-m-n theorem for m = n = 1)
There exist a primitive recursive operator s11 such that
8e, x, y 2 N
if
e (x, y ) #,
then
e (x, y )
=
s11 (e,x) (y ).
This theorem gives directly the currying, so we see that the
Kleene model is a CCC even without proving that K and S
exists.
Pers
Definition and
examples
Model of system F
CCC structure
Model of System
F
We are using the same approach as in the saturated-sets
model.
We use valuations
⇠ : typevariables ! PER(A),
⇢ : typedvariables ! PER(A)
to have the meaning of types (with ”!” and ”8”) and
terms.
Pers
Definition and
examples
Interpretation of !
CCC structure
Model of System
F
We suppose that we have a valuation
⇠ : typevariables ! PER(A).
We define, for a variable type s, JsK⇠ = ⇠(s). Then we can
have the Per Js ! tK⇠ with, for morphisms f and g ,
f Js ! tK⇠ g
i↵
⇣
⌘
8x, y xJsK⇠ y ) f (x) #, g (y ) # & f (x)JtK⇠ g (y ) .
Pers
Definition and
examples
Interpretation of 8
CCC structure
Model of System
F
If f is a morphism from any Per to any Per, we define
8f = \R2PER(A) f (R).
With this definition, the meaning of the 8 is then
J8f K⇠ = \R2PER(A) Jf (R)K⇠ .
As always in system F, all the types are defined by induction
on the variables and these ! and 8, so the interpretation of
these types are also build by induction.
Pers
Interpretation of terms
Definition and
examples
CCC structure
Model of System
F
We now use a valuation
⇢ : typedvariables ! PER(A).
We also need a functional domain U and the meaning that
comes with it. If, for a system F term M, UJMK⇢ is the
meaning of the type erasure of M,
J ` M : tK⇢,⇠ = [UJMK⇢ ]JtK⇠ .
Pers
Definition and
examples
CCC structure
Model of System
F
Soundness and completeness
Theorem (Soundness)
` M = N : t, then
If
J ` M : tK⇢,⇠ = J ` N : tK⇢,⇠ .2
Theorem (Completeness)
”Let Th be any !,8 -theory containing every well-typed
equation ` M = N : with Erase(M)=Erase(N) and
closed under rule
,x:
` M = N: ⌧
` M = N: ⌧
x not free in M, N.
(nonempty)
Then there is a per model without empty types satisfying
exactly the equations in Th”3
2
3
inspired from lemma 8.12 of Carl Gunter’s book, p. 268
theorem 9.3.47 of John Mitchell’s book, p. 676.
Pers
Bibliography
Definition and
examples
CCC structure
Model of System
F
MITCHELL, John C. Foundations for Programming Languages,
MIT Press, 1996. p. 364–385 and 670–679
GUNTER, Carl A. Semantics of Programming Languages:
Structures and Techniques, MIT Press, 1992. p. 266–269 and
376–377
Philipp Scott’s lecture notes (handwritten copy and printed copy)
https://en.wikipedia.org/wiki/Partial equivalence relation
https://ncatlab.org/nlab/show/partial+equivalence+relation
© Copyright 2026 Paperzz