Skip to content

Instantly share code, notes, and snippets.

@yoshihiro503
Created February 18, 2018 11:21
Show Gist options
  • Save yoshihiro503/36f5e70f81eb3c31269112ae5c7a57a1 to your computer and use it in GitHub Desktop.
Save yoshihiro503/36f5e70f81eb3c31269112ae5c7a57a1 to your computer and use it in GitHub Desktop.
Require Import Arith List.
Import ListNotations.
Definition list_reduce_left {A: Type} (f: A -> A -> A) (xs: list A) :=
match xs with
| [] => None
| x :: xs =>
Some (List.fold_left f xs x)
end.
Definition list_max {A: Type} max (xs: list A) := list_reduce_left max xs.
Lemma list_max_Forall_nat : forall xs x,
list_max max xs = Some x ->
List.Forall (fun y => y <= x) xs.
Proof.
(*未解決*)
Admitted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment