lean4-htt/tests/lean/run/finDotCtor.lean
2022-03-12 06:07:04 -08:00

16 lines
392 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.

def get : (as : List α) → (i : Fin as.length) → α
| a::as, .mk 0 _ => a
| a::as, .mk (i+1) h => get as (.mk i (Nat.lt_of_succ_lt_succ h))
namespace Ex
inductive Fin : Nat → Type
| zero : Fin (.succ n)
| succ : Fin n → Fin (.succ n)
deriving Repr
def get : (as : List α) → (i : Fin as.length) → α
| a::as, .zero => a
| a::as, .succ i => get as i
end Ex