Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Last active September 3, 2019 22:47
Show Gist options
  • Select an option

  • Save MarcelineVQ/5152c66371c047860157dad597144502 to your computer and use it in GitHub Desktop.

Select an option

Save MarcelineVQ/5152c66371c047860157dad597144502 to your computer and use it in GitHub Desktop.
module Foo
data Singleton : (x : k) -> Type where
With : (y : a) -> x = y -> Singleton x
inspect : (x : a) -> Singleton x
inspect x = With x Refl
all_values_filtered : (xs:List a) -> (f:a -> Bool) -> (all f (filter f xs) = True)
all_values_filtered [] f = Refl
all_values_filtered (x :: xs) f with (inspect (f x))
all_values_filtered (x :: xs) f | (With False prf) =
rewrite prf in all_values_filtered xs f
all_values_filtered (x :: xs) f | (With True prf) =
rewrite prf
in rewrite prf
in rewrite all_values_filtered xs f
in Refl
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment