Created
May 8, 2024 15:58
-
-
Save leodemoura/15c99ce554b75dbf4972c0768d60bdda to your computer and use it in GitHub Desktop.
ex.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def strict : Bool -> Type | |
| true => Unit | |
| false => Empty | |
def f : (n:Nat) -> strict (n > 0) -> Nat := by | |
intros n | |
match n with | |
| .zero => simp; exact fun i => by nomatch i | |
| n@(.succ _) => simp; exact fun () => n | |
def f2 : (n:Nat) -> (match n with | .zero => Empty | .succ _ => Unit) → Nat | |
| n@(.succ _), _ => n | |
| .zero, h => by simp at h; contradiction | |
#eval f 5 () | |
#eval f2 5 () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment