lean4-htt/tests/lean/run/depHd.lean
Leonardo de Moura 16429e393d test: add dep hd test
It has been reported in the general channel that this example
generates problems for the Lean 3 elaborator.
2021-02-08 11:26:23 -08:00

13 lines
290 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 Hd : List α → Type
| [] => Unit
| a :: _ => α
def hd : (as : List α) → Hd as
| [] => ()
| a :: l => a
theorem inj_hd : (a a': α) → (l l' : List α) → a :: l = a' :: l' → a = a' := by
intro a a' l l' h
show hd (a :: l) = hd (a' :: l')
cases h
rfl