在精益中,您需要明确无法访问的术语:
theorem not_in_greater2 {��: Type} [d: decidable_linear_order ��] : �� (x h: ��) (t: list ��), is_sorted (h::t) �� x < h �� ? list.mem x (h::t) | x h [] _ x_lt_h := _ | x h (y::ys) (is_sorted.is_sorted_many ._ ._ ._ h_lt_y rest_sorted) x_lt_h := _
有关无法访问的术语的更多信息,请参阅第8.5章 https://leanprover.github.io/theorem_proving_in_lean/theorem_proving_in_lean.pdf 。
请注意,Lean会自动为隐式参数使用不可访问的术语:
inductive is_sorted {�� : Type} [decidable_linear_order ��] : list �� �� Type | zero : is_sorted [] | one (x : ��) : is_sorted [x] | many {x y : ��} {ys : list ��} : x < y �� is_sorted (y::ys) �� is_sorted (x::y::ys) theorem not_in_greater2 {�� : Type} [decidable_linear_order ��] : �� (x h : ��) (t : list ��), is_sorted (h::t) �� x < h �� ? list.mem x (h::t) | x h [] _ x_lt_h := not_eq_not_in (ne_of_lt x_lt_h) | x h (y::ys) (is_sorted.many h_lt_y rest_sorted) x_lt_h := _