Coq 如何求自然数表的最小元素

Coq 如何求自然数表的最小元素,coq,Coq,如何找到列表中最小的元素?Coq库中是否有可能使用的内置函数?我有搜索列表min,但没有找到任何内容。在Nat@ana borges中已经定义了min,谢谢,我编辑了我的答案。:)另一个选项是需要导入Coq.Lists.List。选中右折叠Nat.min 0。您的列表在哪里? From Coq Require Import Nat. Fixpoint min_elem xs := match xs with | nil => 0 | x :: nil => x |

如何找到列表中最小的元素?Coq库中是否有可能使用的内置函数?我有搜索列表min,但没有找到任何内容。

Nat
@ana borges中已经定义了
min
,谢谢,我编辑了我的答案。:)另一个选项是
需要导入Coq.Lists.List。选中右折叠Nat.min 0。
您的列表在哪里?
From Coq Require Import Nat.

Fixpoint min_elem xs :=
  match xs with
  | nil => 0
  | x :: nil => x
  | x :: xs' => Nat.min x (min_elem xs')
  end
.