Skip to content

Instantly share code, notes, and snippets.

@prozacchiwawa
Last active April 18, 2021 06:43
Show Gist options
  • Save prozacchiwawa/6051f323e5530a3fb7bb29689ad084d7 to your computer and use it in GitHub Desktop.
Save prozacchiwawa/6051f323e5530a3fb7bb29689ad084d7 to your computer and use it in GitHub Desktop.
module DecBool
-- Given a contra on bool equality (a = b) -> Void, produce a proof of the opposite (that (not a) = b)
public export
invertContraBool : (a : Bool) -> (b : Bool) -> (a = b -> Void) -> (not a = b)
invertContraBool a b contra = invertContraBool_ a b contra
where
fEf : False = False
fEf = Refl
tEt : True = True
tEt = Refl
invertContraBool_ : (a : Bool) -> (b : Bool) -> (a = b -> Void) -> (not a = b)
invertContraBool_ False False contra = absurd (contra fEf)
invertContraBool_ False True contra = Refl
invertContraBool_ True False contra = Refl
invertContraBool_ True True contra = absurd (contra tEt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment