Skip to content

Commit

Permalink
Add orBothFalse proof
Browse files Browse the repository at this point in the history
  • Loading branch information
madman-bob committed Jun 30, 2023
1 parent ecf4765 commit 721a83c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/base/Data/Bool.idr
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ orNotTrue : (x : Bool) -> x || not x = True
orNotTrue False = Refl
orNotTrue True = Refl

export
orBothFalse : {0 x, y : Bool} -> (0 prf : x || y = False) -> (x = False, y = False)
orBothFalse prf = unerase $ orBothFalse' prf
where
unerase : (0 prf : (x = False, y = False)) -> (x = False, y = False)
unerase (p, q) = (irrelevantEq p, irrelevantEq q)

orBothFalse' : {x, y : Bool} -> x || y = False -> (x = False, y = False)
orBothFalse' {x = False} yFalse = (Refl, yFalse)
orBothFalse' {x = True} trueFalse = absurd trueFalse

-- interaction & De Morgan's laws

export
Expand Down

0 comments on commit 721a83c

Please sign in to comment.