lean4-htt/tests/lean/mutualdef1.lean
2020-10-25 09:16:38 -07:00

36 lines
460 B
Text

mutual
def f (x : Nat) : Nat → Nat
| 0 => 1
| x+1 => g x
theorem g (x : Nat) : Nat → Nat -- cannot mix theorems and definitions
| 0 => 2
| x+1 => f x
end
mutual
def f : Nat → Nat
| 0 => 1
| x+1 => g x
example : Nat := -- cannot mix examples and definitions
g 10
end
mutual
def f (x : Nat) : Nat → Nat
| 0 => 1
| x+1 => g x
unsafe def g (x : Nat) : Nat → Nat -- cannot mix safe and unsafe definitions
| 0 => 2
| x+1 => f x
end