に排除することなく、コックに証明するとき、私はソートされたリストの末尾ではなく戦術のパターンマッチングを使用して、コックにソートされていることを証明しようとしている:どのようにプロップのパターンマッチをするタイプ
Require Import Coq.Sorting.Sorted.
Definition tail_also_sorted {A : Prop} {R : relation A} {h : A} {t : list A}
(H: Sorted R (h::t)) : Sorted R t :=
match H in Sorted _ (h::t) return Sorted _ t with
| Sorted_nil _ => Sorted_nil R
| Sorted_cons rest_sorted _ => rest_sorted
end.
inductive is_sorted {α: Type} [decidable_linear_order α] : list α -> Prop
| is_sorted_zero : is_sorted []
| is_sorted_one : ∀ (x: α), is_sorted [x]
| is_sorted_many : ∀ {x y: α} {ys: list α}, x < y -> is_sorted (y::ys) -> is_sorted (x::y::ys)
lemma tail_also_sorted {α: Type} [decidable_linear_order α] : ∀ {h: α} {t: list α},
is_sorted (h::t) -> is_sorted t
| _ [] _ := is_sorted.is_sorted_zero
| _ (y::ys) (is_sorted.is_sorted_many _ rest_sorted) := rest_sorted
:私もCICに基づいて構築され、次のリーンコードタイプ・チェックとして、それは根本的な微積分で可能だ疑い、リーン
Error:
Incorrect elimination of "H" in the inductive type "Sorted":
the return type has sort "Type" while it should be "Prop".
Elimination of an inductive object of sort Prop
is not allowed on a predicate in sort Type
because proofs can be eliminated only to build proofs.
:これはと、しかし、失敗しました
問題を報告する場所はどこですか? – LogicChains
おそらくCoqのバグトラッカー:https://coq.inria.fr/bugs/ –
完了:https://coq.inria.fr/bugs/show_bug.cgi?id=5643。 – LogicChains