lean4-htt/tmp/even_odd.lean

23 lines
630 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.

import data.vector
open nat
universes u v
set_option trace.eqn_compiler.wf_rec true
set_option trace.debug.eqn_compiler.wf_rec true
set_option trace.debug.eqn_compiler.mutual true
mutual def even, odd
with even : nat → bool
| 0 := tt
| (a+1) := odd a
with odd : nat → bool
| 0 := ff
| (a+1) := even a
mutual def f, g {α β : Type u} (f : α → β) (p : α × β)
with f : Π n : nat, vector (α × β) n
| 0 := vector.nil
| (succ n) := vector.cons p $ (g n p.1).map (λ b, (p.1, b))
with g : Π n : nat, α → vector β n
| 0 a := vector.nil
| (succ n) a := vector.cons p.2 $ (f n).map (λ p, p.2)