Encoding. Binary sums/coproducts › Computation [01GL]
You can verify for yourself that the following computation rules hold:
\frac { u:A \quad x:A+B\vdash C[x]~\mathit {type} \quad x:A\vdash v[x]:C[\mathsf {inl}~x] \quad x:B\vdash w[x]:C[\mathsf {inr}~x] }{ \mathsf {case}_{x\mathpunct {.}{C[x]}}(\mathsf {inl}~u;x\mathpunct {.}{v[x]}; x\mathpunct {.}{w[x]}) \equiv v[u] :C[\mathsf {inl}~u] } \frac { u:B \quad x:A+B\vdash C[x]~\mathit {type} \quad x:A\vdash v[x]:C[\mathsf {inl}~x] \quad x:B\vdash w[x]:C[\mathsf {inr}~x] }{ \mathsf {case}_{x\mathpunct {.}{C[x]}}(\mathsf {inr}~u;x\mathpunct {.}{v[x]}; x\mathpunct {.}{w[x]}) \equiv w[u] :C[\mathsf {inr}~u] }