IF YOU CAN SEE THIS go to /sfa/Nuprl/Shared/Xindentation_hack_doc.html
Disjoint Union of Two Types
A+B is called the disjoint union of type A with type B.
The members of A+B are gotten by tagging members from A and B. They are inl(a) for aA and inr(b) for bB.
inl(a) and inr(b) are sometimes called the left- and right-injections of a and b.
InjCase(x; u. e(u); v. f(v))
is the destructor for left- and right-injections.
InjCase(inl(a); u. e(u); v. f(v)) * e(a) InjCase(inr(b); u. e(u); v. f(v)) * f(b)
Some commonly used specializations of InjCase(x; u. e(u); v. f(v)) are:
Def isl(x) == InjCase(x; y. true; z. false) Def outl(x) == InjCase(x; y. y; z. "???") Def outr(x) == InjCase(x; y. "???"; z. z)
Thm* A,B:Type, x:A+B. isl(x) Thm*A,B:Type, x:A+B. isl(x) outl(x) A Thm*A,B:Type, x:A+B. isl(x) outr(x) B
outl(inl(a)) * a outr(inr(b)) * b
A+A is essentially the type A with a bit added.
We treat A+B, inl(a), inr(b), and InjCase(x; u. e(u); v. f(v)) as primitives, but we
could instead have defined them using the pairing operation to add a tag: