lean4-htt/tests/lean/run/psumAtWF.lean
Leonardo de Moura 9ee529e5ce fix: use PSum instead of Sum when using well-founded recursion
See new test for example that did not work with `Sum` because type
alpha was `Sort u`.
2022-02-17 16:14:34 -08:00

16 lines
265 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mutual
def fn (f : αα) (a : α) (n : Nat) : α :=
match n with
| 0 => a
| n+1 => gn f (f (f a)) (f a) n
def gn (f : αα) (a b : α) (n : Nat) : α :=
match n with
| 0 => b
| n+1 => fn f (f b) n
end
termination_by
fn n => n
gn n => n