lean4-htt/old_tests/tests/lean/vm_noncomputable_real.lean
Leonardo de Moura 008b7b2ac2 fix(library/noncomputable): bug at is_noncomputable
In Lean4, the check should be based on the compiler.
That is, a definition should be marked as noncomputable when we cannot
generate code for it.
2018-04-16 14:26:37 -07:00

11 lines
510 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

def := set
constant .sub' :
/-
The following definition is accepted because the type is () which is defeq to ( → Prop).
The code generator can handle it because it is returning a type. Morally, it is the function that takes
three arguments and returns an unit.
-/
def .sub (a b : ) := (λ b, a.sub' b) b
instance : has_sub := ⟨ℝ.sub⟩
constant .nonneg : → Prop
instance : has_le := ⟨λ a b, (b - a).nonneg⟩