```//
// Proving f91 (i) = 91 for every integer i <= 100,
// where [f91] is the famous MacCarthy's 91-function.
//
// Hongwei Xi (hwxi AT cs DOT bu DOT edu)
//

(*
** f91 (i) = f91 (f91 (i+11)) if i <= 100
** f91 (i) = i - 10           otherwise
*)

dataprop F91 (int, int) =
| {i:int | i <= 100} {r1,r2:int}
F91def1 (i, r2) of (F91 (i+11, r1), F91 (r1, r2))
| {i:int | i >= 101} F91def2 (i, i-10) of ()

(* ****** ****** *)

prfun f91_lemma1
{i,r:int | 90 <= i; i <= 101} .<101-i>. (pf: F91 (i, r)): [r==91] void =
sif i == 101 then let
prval F91def2 () = pf
in
// empty
end else let
prval F91def1 (pf1, pf2) = pf // pf1: F91 (i+11, r1); pf2: F91 (r1, r2)
prval F91def2 () = pf1 // r1 = i+11-10 = i+1
in
f91_lemma1 (pf2)
end // end of [sif]

(* ****** ****** *)

prfun f91_lemma2
{i,r:int | i <= 100} .<100-i>. (pf: F91 (i, r)): [r==91] void =
sif i >= 90 then f91_lemma1 (pf) else let
prval F91def1 (pf1, pf2) = pf; prval () = f91_lemma2 (pf1)
in
f91_lemma1 (pf2) // f91 (91) = 91
end // end of [sif]

(* ****** ****** *)

(* end of [f91-alt-2008-09-30.dats] *)
```