% plus, as defined in recitation val plus : nat -> nat -> nat = fn x => fn y => rec x of p 0 => y | p (s x') => s (p x') end; % example proof: n + 0 = 0 proof plusN0N : !n:nat. (plus n 0 = n) = begin [ n:nat; %%%% induction on n %% case n = 0. TS: plus n 0 = n plus 0 0 = 0; %% case n = s n'. TS: n':nat, plus n' 0 = n' %% |- plus (s n') 0 = (s n') [ n':nat, plus n' 0 = n'; plus (s n') 0 = s n' ]; %% apply the induction to conclude: plus n 0 = n ]; !n:nat. plus n 0 = n end; % example proof term using the recursor term plusN0N : !n:nat. (plus n 0 = n) = fn n => rec n of p 0 => eq0 | p (s n') => eqS (p n') end;