Idris2/tests/idris2/rewrite001/Issue2573.idr

14 lines
398 B
Idris
Raw Normal View History

module Issue2573
||| Define foo, the identity function in disguise
foo : Ord a => (x : a) -> a
foo x = if x < x then x else x
||| Assume that foo x = x
eq : Ord a => (a -> a) -> (x : a) -> Issue2573.foo x = x
eq f x = believe_me ()
||| Prove that if x < y then (foo x) < y
prf : Ord a => (a -> a) -> (x, y : a) -> x < y = True -> Issue2573.foo x < y = True
prf f x y lt = rewrite (eq f x) in lt