Created
September 23, 2015 13:12
-
-
Save erutuf/d9ad1bdff34ea7d5130a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import List. | |
Variable A B : Type. | |
Theorem fold_symmetric2 : forall (f : A -> B -> A) (g : B -> A -> A), | |
(forall x y, f x y = g y x) -> | |
forall x l, fold_left f l x = fold_right g x (rev l). | |
Proof with simpl in *; intuition. | |
intros f g H x l. revert x. | |
induction l... | |
rewrite IHl. | |
rewrite fold_right_app... | |
rewrite H... | |
Qed. | |
(* | |
fold_left と fold_right の変換をより一般的な形で | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment