Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leodemoura/15c99ce554b75dbf4972c0768d60bdda to your computer and use it in GitHub Desktop.
Save leodemoura/15c99ce554b75dbf4972c0768d60bdda to your computer and use it in GitHub Desktop.
ex.lean
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