Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) Require Export List. Require Export Sorted. Require Export Setoid Basics Morphisms. Set Implicit Arguments. Unset Strict Implicit. (* Set Universe Polymorphism. *)
This can be seen as a complement of predicate lelistA and sort
found in Sorting.
Section Type_with_equality. Variable A : Type. Variable eqA : A -> A -> Prop.
Being in a list modulo an equality relation over type A.
Inductive InA (x : A) : list A -> Prop := | InA_cons_hd : forall y l, eqA x y -> InA x (y :: l) | InA_cons_tl : forall y l, InA x l -> InA x (y :: l). Hint Constructors InA : core.
TODO: it would be nice to have a generic definition instead
of the previous one. Having InA = Exists eqA raises too
many compatibility issues. For now, we only state the equivalence:
A:TypeeqA:A -> A -> Propforall (x : A) (l : list A), InA x l <-> Exists (eqA x) lsplit; induction 1; auto. Qed.A:TypeeqA:A -> A -> Propforall (x : A) (l : list A), InA x l <-> Exists (eqA x) lA:TypeeqA:A -> A -> Propforall (x y : A) (l : list A), InA x (y :: l) <-> eqA x y \/ InA x lA:TypeeqA:A -> A -> Propforall (x y : A) (l : list A), InA x (y :: l) <-> eqA x y \/ InA x linvlist InA; auto. Qed.A:TypeeqA:A -> A -> Propx, y:Al:list AH:InA x (y :: l)eqA x y \/ InA x lA:TypeeqA:A -> A -> Propforall x : A, InA x nil <-> FalseA:TypeeqA:A -> A -> Propforall x : A, InA x nil <-> Falseinvlist InA. Qed.A:TypeeqA:A -> A -> Propx:AH:InA x nilFalse
An alternative definition of InA.
A:TypeeqA:A -> A -> Propforall (x : A) (l : list A), InA x l <-> (exists y : A, eqA x y /\ In y l)intros; rewrite InA_altdef, Exists_exists; firstorder. Qed.A:TypeeqA:A -> A -> Propforall (x : A) (l : list A), InA x l <-> (exists y : A, eqA x y /\ In y l)
A list without redundancy modulo the equality over A.
Inductive NoDupA : list A -> Prop := | NoDupA_nil : NoDupA nil | NoDupA_cons : forall x l, ~ InA x l -> NoDupA l -> NoDupA (x::l). Hint Constructors NoDupA : core.
An alternative definition of NoDupA based on ForallOrdPairs
A:TypeeqA:A -> A -> Propforall l : list A, NoDupA l <-> ForallOrdPairs (complement eqA) lA:TypeeqA:A -> A -> Propforall l : list A, NoDupA l <-> ForallOrdPairs (complement eqA) lA:TypeeqA:A -> A -> Propx:Al:list AH:~ InA x lH0:NoDupA lIHNoDupA:ForallOrdPairs (complement eqA) lForall (complement eqA x) lA:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA l~ InA a lA:TypeeqA:A -> A -> Propx:Al:list AH:~ InA x lH0:NoDupA lIHNoDupA:ForallOrdPairs (complement eqA) lforall x0 : A, In x0 l -> complement eqA x x0A:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA l~ InA a lA:TypeeqA:A -> A -> Propx:Al:list AH:~ InA x lH0:NoDupA lIHNoDupA:ForallOrdPairs (complement eqA) lb:AHb:In b lcomplement eqA x bA:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA l~ InA a lA:TypeeqA:A -> A -> Propx:Al:list AH:~ InA x lH0:NoDupA lIHNoDupA:ForallOrdPairs (complement eqA) lb:AHb:In b lEq:eqA x bInA x lA:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA l~ InA a lA:TypeeqA:A -> A -> Propx:Al:list AH:~ InA x lH0:NoDupA lIHNoDupA:ForallOrdPairs (complement eqA) lb:AHb:In b lEq:eqA x bexists y : A, eqA x y /\ In y lA:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA l~ InA a lA:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA l~ InA a lA:TypeeqA:A -> A -> Propa:Al:list AH:Forall (complement eqA a) lH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA la':AHaa':eqA a a'Ha':In a' lFalseexact (H a' Ha' Haa'). Qed.A:TypeeqA:A -> A -> Propa:Al:list AH:forall x : A, In x l -> complement eqA a xH0:ForallOrdPairs (complement eqA) lIHForallOrdPairs:NoDupA la':AHaa':eqA a a'Ha':In a' lFalse
lists with same elements modulo eqA
Definition inclA l l' := forall x, InA x l -> InA x l'. Definition equivlistA l l' := forall x, InA x l <-> InA x l'.A:TypeeqA:A -> A -> Propl:list AinclA nil lA:TypeeqA:A -> A -> Propl:list AinclA nil lA:TypeeqA:A -> A -> Propl:list Ax:AInA x nil -> InA x linversion H. Qed. Hint Resolve incl_nil : list.A:TypeeqA:A -> A -> Propl:list Ax:AH:InA x nilInA x l
lists with same elements modulo eqA at the same place
Inductive eqlistA : list A -> list A -> Prop := | eqlistA_nil : eqlistA nil nil | eqlistA_cons : forall x x' l l', eqA x x' -> eqlistA l l' -> eqlistA (x::l) (x'::l'). Hint Constructors eqlistA : core.
We could also have written eqlistA = Forall2 eqA.
A:TypeeqA:A -> A -> Propforall l l' : list A, eqlistA l l' <-> Forall2 eqA l l'split; induction 1; auto. Qed.A:TypeeqA:A -> A -> Propforall l l' : list A, eqlistA l l' <-> Forall2 eqA l l'
Results concerning lists modulo eqA
Hypothesis eqA_equiv : Equivalence eqA. Definition eqarefl := (@Equivalence_Reflexive _ _ eqA_equiv). Definition eqatrans := (@Equivalence_Transitive _ _ eqA_equiv). Definition eqasym := (@Equivalence_Symmetric _ _ eqA_equiv). Hint Resolve eqarefl eqatrans : core. Hint Immediate eqasym : core. Ltac inv := invlist InA; invlist sort; invlist lelistA; invlist NoDupA.
First, the two notions equivlistA and eqlistA are indeed equivlances
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAEquivalence equivlistAfirstorder. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAEquivalence equivlistAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAEquivalence eqlistAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAEquivalence eqlistAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall x : list A, eqlistA x xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall x y : list A, eqlistA x y -> eqlistA y xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall x y z : list A, eqlistA x y -> eqlistA y z -> eqlistA x zA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall x y : list A, eqlistA x y -> eqlistA y xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall x y z : list A, eqlistA x y -> eqlistA y z -> eqlistA x zA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall x y z : list A, eqlistA x y -> eqlistA y z -> eqlistA x zA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:forall z : list A, eqlistA l' z -> eqlistA l zforall z : list A, eqlistA (x' :: l') z -> eqlistA (x :: l) zinvlist eqlistA; eauto with *. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:forall z : list A, eqlistA l' z -> eqlistA l zx'0:Al'0:list AH1:eqlistA (x' :: l') (x'0 :: l'0)H4:eqA x' x'0H6:eqlistA l' l'0eqlistA (x :: l) (x'0 :: l'0)
Moreover, eqlistA implies equivlistA. A reverse result
will be proved later for sorted list without duplicates.
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAsubrelation eqlistA equivlistAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAsubrelation eqlistA equivlistAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':list AH:eqlistA x x'equivlistA x x'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAequivlistA nil nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:equivlistA l l'equivlistA (x :: l) (x' :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:equivlistA l l'equivlistA (x :: l) (x' :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:equivlistA l l'x0:AInA x0 (x :: l) <-> InA x0 (x' :: l')rewrite (IHeqlistA x0), H; intuition. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:equivlistA l l'x0:AeqA x0 x \/ InA x0 l <-> eqA x0 x' \/ InA x0 l'
InA is compatible with eqA (for its first arg) and with
equivlistA (and hence eqlistA) for its second arg
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAProper (eqA ==> equivlistA ==> iff) InAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAProper (eqA ==> equivlistA ==> iff) InAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':AHxx':eqA x x'l, l':list AHll':equivlistA l l'InA x l <-> InA x' l'rewrite 2 InA_alt; firstorder. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, x':AHxx':eqA x x'l, l':list AHll':equivlistA l l'InA x l' <-> InA x' l'
For compatibility, an immediate consequence of InA_compat
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l : list A) (x y : A), eqA x y -> InA x l -> InA y lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l : list A) (x y : A), eqA x y -> InA x l -> InA y lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list Ax, y:AH:eqA x yH':InA x lInA y lauto. Qed. Hint Immediate InA_eqA : core.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list Ax, y:AH:eqA x yH':InA x lInA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l : list A) (x : A), In x l -> InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l : list A) (x : A), In x l -> InA x lsubst; auto. Qed. Hint Resolve In_InA : core.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list Aa:Al0:list AH:forall x0 : A, In x0 l0 -> InA x0 l0x:AH1:a = xInA x (a :: l0)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l : list A) (x : A), InA x l -> exists (l1 : list A) (y : A) (l2 : list A), eqA x y /\ l = l1 ++ y :: l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l : list A) (x : A), InA x l -> exists (l1 : list A) (y : A) (l2 : list A), eqA x y /\ l = l1 ++ y :: l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall x0 : A, InA x0 l -> exists (l1 : list A) (y : A) (l2 : list A), eqA x0 y /\ l = l1 ++ y :: l2x:AH0:eqA x aexists (l1 : list A) (y : A) (l2 : list A), eqA x y /\ a :: l = l1 ++ y :: l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall x0 : A, InA x0 l -> exists (l1 : list A) (y : A) (l2 : list A), eqA x0 y /\ l = l1 ++ y :: l2x:AH0:InA x lexists (l1 : list A) (y : A) (l2 : list A), eqA x y /\ a :: l = l1 ++ y :: l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall x0 : A, InA x0 l -> exists (l1 : list A) (y : A) (l2 : list A), eqA x0 y /\ l = l1 ++ y :: l2x:AH0:InA x lexists (l1 : list A) (y : A) (l2 : list A), eqA x y /\ a :: l = l1 ++ y :: l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall x0 : A, InA x0 l -> exists (l0 : list A) (y0 : A) (l3 : list A), eqA x0 y0 /\ l = l0 ++ y0 :: l3x:AH0:InA x ll1:list Ay:Al2:list AH1:eqA x yH2:l = l1 ++ y :: l2exists (l0 : list A) (y0 : A) (l3 : list A), eqA x y0 /\ a :: l = l0 ++ y0 :: l3split; simpl; f_equal; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall x0 : A, InA x0 l -> exists (l0 : list A) (y0 : A) (l3 : list A), eqA x0 y0 /\ l = l0 ++ y0 :: l3x:AH0:InA x ll1:list Ay:Al2:list AH1:eqA x yH2:l = l1 ++ y :: l2eqA x y /\ a :: l = (a :: l1) ++ y :: l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l1 l2 : list A) (x : A), InA x (l1 ++ l2) -> InA x l1 \/ InA x l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l1 l2 : list A) (x : A), InA x (l1 ++ l2) -> InA x l1 \/ InA x l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al1:list AIHl1:forall (l0 : list A) (x0 : A), InA x0 (l1 ++ l0) -> InA x0 l1 \/ InA x0 l0l2:list Ax:AH:InA x (a :: l1 ++ l2)InA x (a :: l1) \/ InA x l2elim (IHl1 l2 x H0); auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al1:list AIHl1:forall (l0 : list A) (x0 : A), InA x0 (l1 ++ l0) -> InA x0 l1 \/ InA x0 l0l2:list Ax:AH0:InA x (l1 ++ l2)InA x (a :: l1) \/ InA x l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l1 l2 : list A) (x : A), InA x (l1 ++ l2) <-> InA x l1 \/ InA x l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l1 l2 : list A) (x : A), InA x (l1 ++ l2) <-> InA x l1 \/ InA x l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AInA x (l1 ++ l2) -> InA x l1 \/ InA x l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AInA x l1 \/ InA x l2 -> InA x (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AInA x l1 \/ InA x l2 -> InA x (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AH:InA x l1(exists y : A, eqA x y /\ In y l1) -> exists y : A, eqA x y /\ In y (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AH:InA x l2(exists y : A, eqA x y /\ In y l2) -> exists y : A, eqA x y /\ In y (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AH:InA x l1y:AH1:eqA x yH2:In y l1In y (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AH:InA x l2(exists y : A, eqA x y /\ In y l2) -> exists y : A, eqA x y /\ In y (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AH:InA x l2(exists y : A, eqA x y /\ In y l2) -> exists y : A, eqA x y /\ In y (l1 ++ l2)apply in_or_app; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl1, l2:list Ax:AH:InA x l2y:AH1:eqA x yH2:In y l2In y (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (p : A) (m : list A), InA p (rev m) <-> InA p mA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (p : A) (m : list A), InA p (rev m) <-> InA p mA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAp:Am:list A(exists y : A, eqA p y /\ In y (rev m)) <-> (exists y : A, eqA p y /\ In y m)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAp:Am:list Ay:AH0:eqA p yH1:In y (rev m)In y mA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAp:Am:list Ay:AH0:eqA p yH1:In y mIn y (rev m)rewrite <- In_rev; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAp:Am:list Ay:AH0:eqA p yH1:In y mIn y (rev m)
Some more facts about InA
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:AInA x (y :: nil) <-> eqA x yrewrite InA_cons, InA_nil; tauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:AInA x (y :: nil) <-> eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:Al:list AInA x (y :: y :: l) <-> InA x (y :: l)rewrite !InA_cons; tauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:Al:list AInA x (y :: y :: l) <-> InA x (y :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y, z:Al:list AInA x (y :: z :: l) <-> InA x (z :: y :: l)rewrite !InA_cons; tauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y, z:Al:list AInA x (y :: z :: l) <-> InA x (z :: y :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list AInA x (l ++ l) <-> InA x lrewrite InA_app_iff; tauto. Qed. Section NoDupA.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list AInA x (l ++ l) <-> InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall l l' : list A, NoDupA l -> NoDupA l' -> (forall x : A, InA x l -> InA x l' -> False) -> NoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall l l' : list A, NoDupA l -> NoDupA l' -> (forall x : A, InA x l -> InA x l' -> False) -> NoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH:NoDupA (a :: l)H0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseNoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA l~ InA a (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y lFalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y lInA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y lexists y0 : A, eqA a y0 /\ In y0 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'InA a (a :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'InA a l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'InA a l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA ly:AH4:eqA a yH5:In y (l ++ l')H:In y l'exists y0 : A, eqA a y0 /\ In y0 l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lNoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x : A, InA x l -> InA x l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x : A, InA x (a :: l) -> InA x l' -> FalseH2:~ InA a lH3:NoDupA lforall x : A, InA x l -> InA x l' -> Falseapply (H1 x); auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall l'0 : list A, NoDupA l -> NoDupA l'0 -> (forall x0 : A, InA x0 l -> InA x0 l'0 -> False) -> NoDupA (l ++ l'0)l':list AH0:NoDupA l'H1:forall x0 : A, InA x0 (a :: l) -> InA x0 l' -> FalseH2:~ InA a lH3:NoDupA lx:AH:InA x lH4:InA x l'FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall l : list A, NoDupA l -> NoDupA (rev l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall l : list A, NoDupA l -> NoDupA (rev l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqANoDupA nil -> NoDupA (rev nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)NoDupA (a :: l) -> NoDupA (rev (a :: l))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)NoDupA (a :: l) -> NoDupA (rev (a :: l))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H:NoDupA (a :: l)NoDupA (rev l ++ a :: nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lNoDupA (rev l ++ a :: nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lNoDupA (a :: nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lforall x : A, InA x (rev l) -> InA x (a :: nil) -> FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA l~ InA a nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lforall x : A, InA x (rev l) -> InA x (a :: nil) -> FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lforall x : A, InA x (rev l) -> InA x (a :: nil) -> FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lx:AInA x (rev l) -> InA x (a :: nil) -> FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lx:A(exists y : A, eqA x y /\ In y (rev l)) -> InA x (a :: nil) -> FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lx, x1:AH2:eqA x x1H3:In x1 (rev l)InA x (a :: nil) -> FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H0:~ InA a lH1:NoDupA lx, x1:AH2:eqA x x1H3:In x1 (rev l)H4:eqA x aFalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H1:NoDupA lx, x1:AH2:eqA x x1H3:In x1 (rev l)H4:eqA x aInA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H1:NoDupA lx, x1:AH2:eqA x x1H3:In x1 (rev l)H4:eqA x aInA x1 lrewrite In_rev; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:NoDupA l -> NoDupA (rev l)H1:NoDupA lx, x1:AH2:eqA x x1H3:In x1 (rev l)H4:eqA x aIn x1 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l l' : list A) (x : A), NoDupA (l ++ x :: l') -> NoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l l' : list A) (x : A), NoDupA (l ++ x :: l') -> NoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')~ InA a (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (l ++ l'0)l':list Ax:AH1:NoDupA (l ++ x :: l')H0:InA a (l ++ l')InA a (l ++ x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (l ++ l'0)l':list Ax:AH1:NoDupA (l ++ x :: l')H0:InA a l \/ InA a l'InA a l \/ InA a (x :: l')intuition. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (l ++ l'0)l':list Ax:AH1:NoDupA (l ++ x :: l')H0:InA a l \/ InA a l'InA a l \/ eqA a x \/ InA a l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l l' : list A) (x : A), NoDupA (l ++ x :: l') -> NoDupA (x :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall (l l' : list A) (x : A), NoDupA (l ++ x :: l') -> NoDupA (x :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (x :: a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')~ InA x (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H2:NoDupA (x :: l ++ l')~ InA x (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')~ InA x (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')~ (eqA x a \/ InA x (l ++ l'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')H2:eqA x aFalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')H2:InA x (l ++ l')FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')H2:eqA x aInA a (l ++ x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')H2:InA x (l ++ l')FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')H:~ InA x (l ++ l')H3:NoDupA (l ++ l')H2:InA x (l ++ l')FalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (a :: l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')~ InA a (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH1:NoDupA (l ++ x :: l')H0:InA a (l ++ l')InA a (l ++ x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (l ++ l')eapply NoDupA_split; eauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AIHl:forall (l'0 : list A) (x0 : A), NoDupA (l ++ x0 :: l'0) -> NoDupA (x0 :: l ++ l'0)l':list Ax:AH0:~ InA a (l ++ x :: l')H1:NoDupA (l ++ x :: l')NoDupA (l ++ l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:ANoDupA (x :: nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:ANoDupA (x :: nil)inversion 1. Qed. End NoDupA. Section EquivlistA.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:A~ InA x nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAProper (eqA ==> equivlistA ==> equivlistA) consintros ? ? E1 ? ? E2 ?; now rewrite !InA_cons, E1, E2. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAProper (eqA ==> equivlistA ==> equivlistA) consA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAProper (equivlistA ==> equivlistA ==> equivlistA) (app (A:=A))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAProper (equivlistA ==> equivlistA ==> equivlistA) (app (A:=A))now rewrite !InA_app_iff, E1, E2. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:list AE1:equivlistA x yx0, y0:list AE2:equivlistA x0 y0x1:AInA x1 (x ++ x0) <-> InA x1 (y ++ y0)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list A~ equivlistA (x :: l) nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list A~ equivlistA (x :: l) nilnow eapply InA_nil, E, InA_cons_hd. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list AE:equivlistA (x :: l) nilFalseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list AequivlistA l nil -> l = nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list AequivlistA l nil -> l = nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAequivlistA nil nil -> nil = nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AequivlistA (a :: l) nil -> a :: l = niltrivial.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAequivlistA nil nil -> nil = nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AequivlistA (a :: l) nil -> a :: l = nilnow apply equivlistA_cons_nil in H. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAa:Al:list AH:equivlistA (a :: l) nila :: l = nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list AequivlistA (x :: x :: l) (x :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list AequivlistA (x :: x :: l) (x :: l)apply InA_double_head. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx:Al:list Ax0:AInA x0 (x :: x :: l) <-> InA x0 (x :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:Al:list AequivlistA (x :: y :: l) (y :: x :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:Al:list AequivlistA (x :: y :: l) (y :: x :: l)apply InA_permute_heads. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAx, y:Al:list Ax0:AInA x0 (x :: y :: l) <-> InA x0 (y :: x :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list AequivlistA (l ++ l) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list AequivlistA (l ++ l) lapply InA_app_idem. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl:list Ax:AInA x (l ++ l) <-> InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AeqA x y -> NoDupA (x :: l) -> NoDupA (l1 ++ y :: l2) -> equivlistA (x :: l) (l1 ++ y :: l2) -> equivlistA l (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AeqA x y -> NoDupA (x :: l) -> NoDupA (l1 ++ y :: l2) -> equivlistA (x :: l) (l1 ++ y :: l2) -> equivlistA l (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH0:NoDupA (x :: l)H1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AInA a l <-> InA a (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH0:NoDupA (x :: l)H1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AInA a (x :: l) <-> InA a (l1 ++ y :: l2) -> InA a l <-> InA a (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH0:NoDupA (x :: l)H1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AeqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2 -> InA a l <-> InA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA leqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2 -> InA a l <-> InA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lSW:NoDupA (y :: l1 ++ l2)eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2 -> InA a l <-> InA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ InA y (l1 ++ l2)H5:NoDupA (l1 ++ l2)eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2 -> InA a l <-> InA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2 -> InA a l <-> InA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a lInA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a l1 \/ InA a l2InA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a lH8:~ eqA a xInA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a l1 \/ InA a l2InA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a lH8:~ eqA a xH9:~ eqA a yInA a l1 \/ InA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a l1 \/ InA a l2InA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a l1 \/ InA a l2InA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H6:eqA a x \/ InA a l <-> InA a l1 \/ eqA a y \/ InA a l2H7:InA a l1 \/ InA a l2OR:eqA a x \/ InA a lInA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H7:InA a l1 \/ InA a l2OR:eqA a x \/ InA a lInA a lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H7:InA a l1 \/ InA a l2EQN:eqA a xInA a lrewrite <-H,<-EQN; auto. Qed. End EquivlistA. Section Fold. Variable B:Type. Variable eqB:B->B->Prop. Variable st:Equivalence eqB. Variable f:A->B->B. Variable i:B. Variable Comp:Proper (eqA==>eqB==>eqB) f.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAl, l1, l2:list Ax, y:AH:eqA x yH1:NoDupA (l1 ++ y :: l2)H2:equivlistA (x :: l) (l1 ++ y :: l2)a:AH3:~ InA x lH4:NoDupA lH0:~ (InA y l1 \/ InA y l2)H5:NoDupA (l1 ++ l2)H7:InA a l1 \/ InA a l2EQN:eqA a xInA y l1 \/ InA y l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fforall s s' : list A, eqlistA s s' -> eqB (fold_right f i s) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fforall s s' : list A, eqlistA s s' -> eqB (fold_right f i s) (fold_right f i s')apply Comp; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:eqB (fold_right f i l) (fold_right f i l')eqB (f x (fold_right f i l)) (f x' (fold_right f i l'))
Fold with restricted transpose hypothesis.
Section Fold_With_Restriction. Variable R : A -> A -> Prop. Hypothesis R_sym : Symmetric R. Hypothesis R_compat : Proper (eqA==>eqA==>iff) R. (* (** [ForallOrdPairs R] is compatible with [equivlistA] over the lists without duplicates, as long as the relation [R] is symmetric and compatible with [eqA]. To prove this fact, we use an auxiliary notion: "forall distinct pairs, ...". *) Definition ForallNeqPairs := ForallPairs (fun a b => ~eqA a b -> R a b). (** [ForallOrdPairs] and [ForallNeqPairs] are related, but not completely equivalent. For proving one implication, we need to know that the list has no duplicated elements... *) Lemma ForallNeqPairs_ForallOrdPairs : forall l, NoDupA l -> ForallNeqPairs l -> ForallOrdPairs R l. Proof. induction l; auto. constructor. inv. rewrite Forall_forall; intros b Hb. apply H0; simpl; auto. contradict H1; rewrite H1; auto. apply IHl. inv; auto. intros b c Hb Hc Hneq. apply H0; simpl; auto. Qed. (** ... and for proving the other implication, we need to be able to reverse relation [R]. *) Lemma ForallOrdPairs_ForallNeqPairs : forall l, ForallOrdPairs R l -> ForallNeqPairs l. Proof. intros l Hl x y Hx Hy N. destruct (ForallOrdPairs_In Hl x y Hx Hy) as [H|[H|H]]. subst; elim N; auto. assumption. apply R_sym; assumption. Qed. *)
Compatibility of ForallOrdPairs with respect to inclA.
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rforall l l' : list A, NoDupA l' -> inclA l' l -> ForallOrdPairs R l -> ForallOrdPairs R l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rforall l l' : list A, NoDupA l' -> inclA l' l -> ForallOrdPairs R l -> ForallOrdPairs R l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list ANoDupA nil -> inclA nil l -> ForallOrdPairs R l -> ForallOrdPairs R nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> inclA l' l -> ForallOrdPairs R l -> ForallOrdPairs R l'NoDupA (x :: l') -> inclA (x :: l') l -> ForallOrdPairs R l -> ForallOrdPairs R (x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> inclA l' l -> ForallOrdPairs R l -> ForallOrdPairs R l'NoDupA (x :: l') -> inclA (x :: l') l -> ForallOrdPairs R l -> ForallOrdPairs R (x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> inclA l' l -> ForallOrdPairs R l -> ForallOrdPairs R l'ND:NoDupA (x :: l')Incl:inclA (x :: l') lFOP:ForallOrdPairs R lForallOrdPairs R (x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'Forall (R x) l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'R x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'Ix:InA x (x :: l')R x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'Ix:InA x lR x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'Ix:exists y0 : A, eqA x y0 /\ In y0 lR x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' lR x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' lIy:InA y (x :: l')R x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' lIy:InA y lR x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' lIy:exists y0 : A, eqA y y0 /\ In y0 lR x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' ly':AHyy':eqA y y'Hy':In y' lR x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' ly':AHyy':eqA y y'Hy':In y' lR x' y'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' ly':AHyy':eqA y y'Hy':In y' lE:x' = y'R x' y'rewrite Hxx', E, <- Hyy'; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) Rl:list Ax:Al':list AIH:NoDupA l' -> (forall x0 : A, InA x0 l' -> InA x0 l) -> ForallOrdPairs R l -> ForallOrdPairs R l'Incl:forall x0 : A, InA x0 (x :: l') -> InA x0 lFOP:ForallOrdPairs R lH:~ InA x l'H0:NoDupA l'y:AHy:In y l'x':AHxx':eqA x x'Hx':In x' ly':AHyy':eqA y y'Hy':In y' lE:x' = y'InA x l'
Two-argument functions that allow to reorder their arguments.
Definition transpose (f : A -> B -> B) :=
forall (x y : A) (z : B), eqB (f x (f y z)) (f y (f x z)).
A version of transpose with restriction on where it should hold
Definition transpose_restr (R : A -> A -> Prop)(f : A -> B -> B) := forall (x y : A) (z : B), R x y -> eqB (f x (f y z)) (f y (f x z)). Variable TraR :transpose_restr R f.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fforall (s1 s2 : list A) (x : A), ForallOrdPairs R (s1 ++ x :: s2) -> eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fforall (s1 s2 : list A) (x : A), ForallOrdPairs R (s1 ++ x :: s2) -> eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs2:list Ax:AH:ForallOrdPairs R (x :: s2)eqB (f x (fold_right f i s2)) (f x (fold_right f i s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (fold_right f i (s1 ++ x :: s2))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (fold_right f i (s1 ++ x :: s2))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (fold_right f i (s1 ++ x :: s2))) (f a (f x (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f i (s1 ++ s2)))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f i (s1 ++ s2)))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)ForallOrdPairs R (s1 ++ x :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f i (s1 ++ s2)))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f i (s1 ++ s2)))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH:ForallOrdPairs R (a :: s1 ++ x :: s2)R a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH0:Forall (R a) (s1 ++ x :: s2)H1:ForallOrdPairs R (s1 ++ x :: s2)R a xapply in_or_app; simpl; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AH0:forall x0 : A, In x0 (s1 ++ x :: s2) -> R a x0H1:ForallOrdPairs R (s1 ++ x :: s2)In x (s1 ++ x :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fforall s s' : list A, NoDupA s -> NoDupA s' -> ForallOrdPairs R s -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fforall s s' : list A, NoDupA s -> NoDupA s' -> ForallOrdPairs R s -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall s' : list A, NoDupA nil -> NoDupA s' -> ForallOrdPairs R nil -> equivlistA nil s' -> eqB (fold_right f i nil) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall (a : A) (l : list A), (forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')) -> forall s' : list A, NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB (fold_right f i (a :: l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list ANoDupA nil -> NoDupA nil -> ForallOrdPairs R nil -> equivlistA nil nil -> eqB i iA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aa:As':list ANoDupA nil -> NoDupA (a :: s') -> ForallOrdPairs R nil -> equivlistA nil (a :: s') -> eqB i (f a (fold_right f i s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall (a : A) (l : list A), (forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')) -> forall s' : list A, NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB (fold_right f i (a :: l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aa:As':list ANoDupA nil -> NoDupA (a :: s') -> ForallOrdPairs R nil -> equivlistA nil (a :: s') -> eqB i (f a (fold_right f i s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall (a : A) (l : list A), (forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')) -> forall s' : list A, NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB (fold_right f i (a :: l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aa:As':list AH:NoDupA nilH0:NoDupA (a :: s')H1:ForallOrdPairs R nilH2:forall x : A, InA x nil <-> InA x (a :: s')eqB i (f a (fold_right f i s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall (a : A) (l : list A), (forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')) -> forall s' : list A, NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB (fold_right f i (a :: l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aa:As':list AH:NoDupA nilH0:NoDupA (a :: s')H1:ForallOrdPairs R nilH2:forall x : A, InA x nil <-> InA x (a :: s')H3:InA a nil -> InA a (a :: s')H4:InA a (a :: s') -> InA a nileqB i (f a (fold_right f i s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall (a : A) (l : list A), (forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')) -> forall s' : list A, NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB (fold_right f i (a :: l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Aforall (a : A) (l : list A), (forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')) -> forall s' : list A, NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB (fold_right f i (a :: l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s'0 : list A, NoDupA l -> NoDupA s'0 -> ForallOrdPairs R l -> equivlistA l s'0 -> eqB (fold_right f i l) (fold_right f i s'0)s':list AN:NoDupA (x :: l)N':NoDupA s'F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) s'eqB (f x (fold_right f i l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s'0 : list A, NoDupA l -> NoDupA s'0 -> ForallOrdPairs R l -> equivlistA l s'0 -> eqB (fold_right f i l) (fold_right f i s'0)s':list AN:NoDupA (x :: l)N':NoDupA s'F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) s'H:InA x s'eqB (f x (fold_right f i l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s'0 : list A, NoDupA l -> NoDupA s'0 -> ForallOrdPairs R l -> equivlistA l s'0 -> eqB (fold_right f i l) (fold_right f i s'0)s':list AN:NoDupA (x :: l)N':NoDupA s'F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) s'H:InA x s's1:list Ay:As2:list AH1:eqA x yH2:s' = s1 ++ y :: s2eqB (f x (fold_right f i l)) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i l)) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i l)) (f x (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (fold_right f i l) (fold_right f i (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yNoDupA lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yNoDupA (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yNoDupA (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i (s1 ++ s2))) (f y (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f y (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (fold_right f i (s1 ++ s2)) (fold_right f i (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f y (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yeqB (f y (fold_right f i (s1 ++ s2))) (fold_right f i (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R (s1 ++ y :: s2)red; intros; rewrite E; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fs:list Ax:Al:list AHrec:forall s' : list A, NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB (fold_right f i l) (fold_right f i s')N:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)H:InA x (s1 ++ y :: s2)E:equivlistA (x :: l) (s1 ++ y :: s2)H1:eqA x yinclA (s1 ++ y :: s2) (x :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fforall (s' s : list A) (x : A), NoDupA s -> NoDupA s' -> ForallOrdPairs R s' -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f i s))intros; apply (@fold_right_equivlistA_restr s' (x::s)); auto. Qed. End Fold_With_Restriction.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr R fforall (s' s : list A) (x : A), NoDupA s -> NoDupA s' -> ForallOrdPairs R s' -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f i s))
we now state similar results, but without restriction on transpose.
Variable Tra :transpose f.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fforall (s1 s2 : list A) (x : A), eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fforall (s1 s2 : list A) (x : A), eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fs2:list Ax:AeqB (f x (fold_right f i s2)) (f x (fold_right f i s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AeqB (f a (fold_right f i (s1 ++ x :: s2))) (f x (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AeqB (f a (fold_right f i (s1 ++ x :: s2))) (f x (f a (fold_right f i (s1 ++ s2))))apply Comp; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fa:As1:list AIHs1:forall (s0 : list A) (x0 : A), eqB (fold_right f i (s1 ++ x0 :: s0)) (f x0 (fold_right f i (s1 ++ s0)))s2:list Ax:AeqB (f a (fold_right f i (s1 ++ x :: s2))) (f a (f x (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fforall s s' : list A, NoDupA s -> NoDupA s' -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f i s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fforall s s' : list A, NoDupA s -> NoDupA s' -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f i s')apply ForallPairs_ForallOrdPairs; try red; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fs, s':list AH:NoDupA sH0:NoDupA s'H1:equivlistA s s'ForallOrdPairs (fun _ _ : A => True) sA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fforall (s' s : list A) (x : A), NoDupA s -> NoDupA s' -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f i s))intros; apply (@fold_right_equivlistA s' (x::s)); auto. Qed. End Fold. Section Fold2. Variable B:Type. Variable eqB:B->B->Prop. Variable st:Equivalence eqB. Variable f:A->B->B. Variable Comp:Proper (eqA==>eqB==>eqB) f.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> Bi:BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose fforall (s' s : list A) (x : A), NoDupA s -> NoDupA s' -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f i s))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fforall (s s' : list A) (i j : B), eqB i j -> eqlistA s s' -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fforall (s s' : list A) (i j : B), eqB i j -> eqlistA s s' -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fs:list Aforall (s' : list A) (i j : B), eqB i j -> eqlistA s s' -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fs':list Ai, j:Bheqij:eqB i jheqss':eqlistA nil s'eqB (fold_right f i nil) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s'0 : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s'0 -> eqB (fold_right f i0 s) (fold_right f j0 s'0)s':list Ai, j:Bheqij:eqB i jheqss':eqlistA (a :: s) s'eqB (fold_right f i (a :: s)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fs':list Ai, j:Bheqij:eqB i jheqss':eqlistA nil s'eqB (fold_right f i nil) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fs':list Ai, j:Bheqij:eqB i jheqss':eqlistA nil s'H0:nil = s'eqB (fold_right f i nil) (fold_right f j nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fi, j:Bheqij:eqB i jheqss':eqlistA nil nileqB (fold_right f i nil) (fold_right f j nil)assumption.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fi, j:Bheqij:eqB i jheqss':eqlistA nil nileqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s'0 : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s'0 -> eqB (fold_right f i0 s) (fold_right f j0 s'0)s':list Ai, j:Bheqij:eqB i jheqss':eqlistA (a :: s) s'eqB (fold_right f i (a :: s)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s'0 : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s'0 -> eqB (fold_right f i0 s) (fold_right f j0 s'0)s':list Ai, j:Bheqij:eqB i jheqss':eqlistA (a :: s) s'x, x':Al, l':list AH1:eqA a x'H3:eqlistA s l'H:x = aH0:l = sH2:x' :: l' = s'eqB (fold_right f i (a :: s)) (fold_right f j (x' :: l'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s' : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s' -> eqB (fold_right f i0 s) (fold_right f j0 s')i, j:Bheqij:eqB i jx':Al':list Aheqss':eqlistA (a :: s) (x' :: l')H1:eqA a x'H3:eqlistA s l'eqB (fold_right f i (a :: s)) (fold_right f j (x' :: l'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s' : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s' -> eqB (fold_right f i0 s) (fold_right f j0 s')i, j:Bheqij:eqB i jx':Al':list Aheqss':eqlistA (a :: s) (x' :: l')H1:eqA a x'H3:eqlistA s l'eqB (f a (fold_right f i s)) (f x' (fold_right f j l'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s' : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s' -> eqB (fold_right f i0 s) (fold_right f j0 s')i, j:Bheqij:eqB i jx':Al':list Aheqss':eqlistA (a :: s) (x' :: l')H1:eqA a x'H3:eqlistA s l'eqA a x'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s' : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s' -> eqB (fold_right f i0 s) (fold_right f j0 s')i, j:Bheqij:eqB i jx':Al':list Aheqss':eqlistA (a :: s) (x' :: l')H1:eqA a x'H3:eqlistA s l'eqB (fold_right f i s) (fold_right f j l')assumption.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s' : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s' -> eqB (fold_right f i0 s) (fold_right f j0 s')i, j:Bheqij:eqB i jx':Al':list Aheqss':eqlistA (a :: s) (x' :: l')H1:eqA a x'H3:eqlistA s l'eqA a x'apply IHs;assumption. Qed. Section Fold2_With_Restriction. Variable R : A -> A -> Prop. Hypothesis R_sym : Symmetric R. Hypothesis R_compat : Proper (eqA==>eqA==>iff) R.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fa:As:list AIHs:forall (s' : list A) (i0 j0 : B), eqB i0 j0 -> eqlistA s s' -> eqB (fold_right f i0 s) (fold_right f j0 s')i, j:Bheqij:eqB i jx':Al':list Aheqss':eqlistA (a :: s) (x' :: l')H1:eqA a x'H3:eqlistA s l'eqB (fold_right f i s) (fold_right f j l')
Two-argument functions that allow to reorder their arguments.
Definition transpose2 (f : A -> B -> B) :=
forall (x y : A) (z z': B), eqB z z' -> eqB (f x (f y z)) (f y (f x z')).
A version of transpose with restriction on where it should hold
Definition transpose_restr2 (R : A -> A -> Prop)(f : A -> B -> B) := forall (x y : A) (z z': B), R x y -> eqB z z' -> eqB (f x (f y z)) (f y (f x z')). Variable TraR :transpose_restr2 R f.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fforall (s1 s2 : list A) (x : A) (i j : B), eqB i j -> ForallOrdPairs R (s1 ++ x :: s2) -> eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f j (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fforall (s1 s2 : list A) (x : A) (i j : B), eqB i j -> ForallOrdPairs R (s1 ++ x :: s2) -> eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f j (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqB (f x (fold_right f i s2)) (f x (fold_right f j s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (fold_right f i (s1 ++ x :: s2))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqB (f x (fold_right f i s2)) (f x (fold_right f j s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqA x xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqB (fold_right f i s2) (fold_right f j s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqA x xapply Equivalence_Reflexive.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)Equivalence_Reflexive:Reflexive eqAEquivalence_Symmetric:Symmetric eqAEquivalence_Transitive:Transitive eqAeqA x xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqB (fold_right f i s2) (fold_right f j s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqlistA s2 s2assumption.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqB i jreflexivity.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (x :: s2)eqlistA s2 s2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (fold_right f i (s1 ++ x :: s2))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (fold_right f i (s1 ++ x :: s2))) (f a (f x (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f j (s1 ++ s2)))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (fold_right f i (s1 ++ x :: s2)) (f x (fold_right f j (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f j (s1 ++ s2)))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)ForallOrdPairs R (s1 ++ x :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f j (s1 ++ s2)))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)ForallOrdPairs R (s1 ++ x :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f j (s1 ++ s2)))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (f a (f x (fold_right f j (s1 ++ s2)))) (f x (f a (fold_right f j (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)R a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (fold_right f j (s1 ++ s2)) (fold_right f j (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH0:Forall (R a) (s1 ++ x :: s2)H1:ForallOrdPairs R (s1 ++ x :: s2)R a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (fold_right f j (s1 ++ s2)) (fold_right f j (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH0:forall x0 : A, In x0 (s1 ++ x :: s2) -> R a x0H1:ForallOrdPairs R (s1 ++ x :: s2)In x (s1 ++ x :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (fold_right f j (s1 ++ s2)) (fold_right f j (s1 ++ s2))reflexivity. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fa:As1:list AIHs1:forall (s0 : list A) (x0 : A) (i0 j0 : B), eqB i0 j0 -> ForallOrdPairs R (s1 ++ x0 :: s0) -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x0 (fold_right f j0 (s1 ++ s0)))s2:list Ax:Ai, j:Bheqij:eqB i jH:ForallOrdPairs R (a :: s1 ++ x :: s2)eqB (fold_right f j (s1 ++ s2)) (fold_right f j (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fforall (s s' : list A) (i j : B), NoDupA s -> NoDupA s' -> ForallOrdPairs R s -> equivlistA s s' -> eqB i j -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fforall (s s' : list A) (i j : B), NoDupA s -> NoDupA s' -> ForallOrdPairs R s -> equivlistA s s' -> eqB i j -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (s' : list A) (i j : B), NoDupA nil -> NoDupA s' -> ForallOrdPairs R nil -> equivlistA nil s' -> eqB i j -> eqB (fold_right f i nil) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall i j : B, NoDupA nil -> NoDupA nil -> ForallOrdPairs R nil -> equivlistA nil nil -> eqB i j -> eqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aa:As':list Aforall i j : B, NoDupA nil -> NoDupA (a :: s') -> ForallOrdPairs R nil -> equivlistA nil (a :: s') -> eqB i j -> eqB i (f a (fold_right f j s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ai, j:BH, H0:NoDupA nilH1:ForallOrdPairs R nilH2:equivlistA nil nilH3:eqB i jeqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aa:As':list Aforall i j : B, NoDupA nil -> NoDupA (a :: s') -> ForallOrdPairs R nil -> equivlistA nil (a :: s') -> eqB i j -> eqB i (f a (fold_right f j s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aa:As':list Aforall i j : B, NoDupA nil -> NoDupA (a :: s') -> ForallOrdPairs R nil -> equivlistA nil (a :: s') -> eqB i j -> eqB i (f a (fold_right f j s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aa:As':list Ai, j:BH:NoDupA nilH0:NoDupA (a :: s')H1:ForallOrdPairs R nilH2:forall x : A, InA x nil <-> InA x (a :: s')H3:eqB i jeqB i (f a (fold_right f j s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aa:As':list Ai, j:BH:NoDupA nilH0:NoDupA (a :: s')H1:ForallOrdPairs R nilH2:forall x : A, InA x nil <-> InA x (a :: s')H3:eqB i jH4:InA a nil -> InA a (a :: s')H5:InA a (a :: s') -> InA a nileqB i (f a (fold_right f j s'))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Aforall (a : A) (l : list A), (forall (s' : list A) (i j : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i j -> eqB (fold_right f i l) (fold_right f j s')) -> forall (s' : list A) (i j : B), NoDupA (a :: l) -> NoDupA s' -> ForallOrdPairs R (a :: l) -> equivlistA (a :: l) s' -> eqB i j -> eqB (fold_right f i (a :: l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s'0 : list A) (i0 j0 : B), NoDupA l -> NoDupA s'0 -> ForallOrdPairs R l -> equivlistA l s'0 -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s'0)s':list Ai, j:BN:NoDupA (x :: l)N':NoDupA s'F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) s'eqij:eqB i jeqB (f x (fold_right f i l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s'0 : list A) (i0 j0 : B), NoDupA l -> NoDupA s'0 -> ForallOrdPairs R l -> equivlistA l s'0 -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s'0)s':list Ai, j:BN:NoDupA (x :: l)N':NoDupA s'F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) s'eqij:eqB i jH:InA x s'eqB (f x (fold_right f i l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s'0 : list A) (i0 j0 : B), NoDupA l -> NoDupA s'0 -> ForallOrdPairs R l -> equivlistA l s'0 -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s'0)s':list Ai, j:BN:NoDupA (x :: l)N':NoDupA s'F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) s'eqij:eqB i jH:InA x s's1:list Ay:As2:list AH1:eqA x yH2:s' = s1 ++ y :: s2eqB (f x (fold_right f i l)) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i l)) (fold_right f j (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i l)) (f x (fold_right f j (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f j (s1 ++ s2))) (fold_right f j (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f i l)) (f x (fold_right f j (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (fold_right f i l) (fold_right f j (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yNoDupA lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yNoDupA (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yNoDupA (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)eapply equivlistA_NoDupA_split; eauto.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yequivlistA l (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f j (s1 ++ s2))) (fold_right f j (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f j (s1 ++ s2))) (f y (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f y (fold_right f i (s1 ++ s2))) (fold_right f j (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f x (fold_right f j (s1 ++ s2))) (f y (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (fold_right f j (s1 ++ s2)) (fold_right f i (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (fold_right f i (s1 ++ s2)) (fold_right f j (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqlistA (s1 ++ s2) (s1 ++ s2)assumption.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB i jreflexivity.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqlistA (s1 ++ s2) (s1 ++ s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (f y (fold_right f i (s1 ++ s2))) (fold_right f j (s1 ++ y :: s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB (fold_right f j (s1 ++ y :: s2)) (f y (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB j iA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R (s1 ++ y :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yeqB i jA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R (s1 ++ y :: s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yForallOrdPairs R (s1 ++ y :: s2)red; intros; rewrite E; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fs:list Ax:Al:list AHrec:forall (s' : list A) (i0 j0 : B), NoDupA l -> NoDupA s' -> ForallOrdPairs R l -> equivlistA l s' -> eqB i0 j0 -> eqB (fold_right f i0 l) (fold_right f j0 s')i, j:BN:NoDupA (x :: l)s1:list Ay:As2:list AN':NoDupA (s1 ++ y :: s2)F:ForallOrdPairs R (x :: l)E:equivlistA (x :: l) (s1 ++ y :: s2)eqij:eqB i jH:InA x (s1 ++ y :: s2)H1:eqA x yinclA (s1 ++ y :: s2) (x :: l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fforall (s' s : list A) (i j : B) (x : A), NoDupA s -> NoDupA s' -> eqB i j -> ForallOrdPairs R s' -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f j s))intros; apply (@fold_right_equivlistA_restr2 s' (x::s) i j); auto. Qed. End Fold2_With_Restriction. Variable Tra :transpose2 f.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fR:A -> A -> PropR_sym:Symmetric RR_compat:Proper (eqA ==> eqA ==> iff) RTraR:transpose_restr2 R fforall (s' s : list A) (i j : B) (x : A), NoDupA s -> NoDupA s' -> eqB i j -> ForallOrdPairs R s' -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f j s))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fforall (s1 s2 : list A) (i : B) (x x' : A), eqA x x' -> eqB (fold_right f i (s1 ++ x :: s2)) (f x' (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fforall (s1 s2 : list A) (i : B) (x x' : A), eqA x x' -> eqB (fold_right f i (s1 ++ x :: s2)) (f x' (fold_right f i (s1 ++ s2)))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fs2:list Ai:Bx, x':AH:eqA x x'eqB (f x (fold_right f i s2)) (f x' (fold_right f i s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (f a (fold_right f i (s1 ++ x :: s2))) (f x' (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fs2:list Ai:Bx, x':AH:eqA x x'eqB (f x (fold_right f i s2)) (f x' (fold_right f i s2))reflexivity.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fs2:list Ai:Bx, x':AH:eqA x x'eqB (fold_right f i s2) (fold_right f i s2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (f a (fold_right f i (s1 ++ x :: s2))) (f x' (f a (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (f a (fold_right f i (s1 ++ x :: s2))) (f a (f x' (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (f a (f x' (fold_right f i (s1 ++ s2)))) (f x' (f a (fold_right f i (s1 ++ s2))))apply Comp;auto.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (f a (fold_right f i (s1 ++ x :: s2))) (f a (f x' (fold_right f i (s1 ++ s2))))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (f a (f x' (fold_right f i (s1 ++ s2)))) (f x' (f a (fold_right f i (s1 ++ s2))))reflexivity. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fa:As1:list AIHs1:forall (s0 : list A) (i0 : B) (x0 x'0 : A), eqA x0 x'0 -> eqB (fold_right f i0 (s1 ++ x0 :: s0)) (f x'0 (fold_right f i0 (s1 ++ s0)))s2:list Ai:Bx, x':AH:eqA x x'eqB (fold_right f i (s1 ++ s2)) (fold_right f i (s1 ++ s2))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fforall (s s' : list A) (i j : B), NoDupA s -> NoDupA s' -> eqB i j -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fforall (s s' : list A) (i j : B), NoDupA s -> NoDupA s' -> eqB i j -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f j s')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:forall (x y : A) (z z' : B), eqB z z' -> eqB (f x (f y z)) (f y (f x z'))forall (s s' : list A) (i j : B), NoDupA s -> NoDupA s' -> eqB i j -> equivlistA s s' -> eqB (fold_right f i s) (fold_right f j s')apply ForallPairs_ForallOrdPairs; try red; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:forall (x y : A) (z z' : B), eqB z z' -> eqB (f x (f y z)) (f y (f x z'))s, s':list Ai, j:BH:NoDupA sH0:NoDupA s'H1:eqB i jH2:equivlistA s s'ForallOrdPairs (fun _ _ : A => True) sA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fforall (s' s : list A) (i j : B) (x : A), NoDupA s -> NoDupA s' -> eqB i j -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f j s))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fforall (s' s : list A) (i j : B) (x : A), NoDupA s -> NoDupA s' -> eqB i j -> ~ InA x s -> equivlistA s' (x :: s) -> eqB (fold_right f i s') (f x (fold_right f j s))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fs', s:list Ai, j:Bx:AH:NoDupA sH0:NoDupA s'H1:eqB i jH2:~ InA x sH3:equivlistA s' (x :: s)eqB (fold_right f i s') (f x (fold_right f j s))eapply fold_right_equivlistA2;auto. Qed. End Fold2. Section Remove. Hypothesis eqA_dec : forall x y : A, {eqA x y}+{~(eqA x y)}.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAB:TypeeqB:B -> B -> Propst:Equivalence eqBf:A -> B -> BComp:Proper (eqA ==> eqB ==> eqB) fTra:transpose2 fs', s:list Ai, j:Bx:AH:NoDupA sH0:NoDupA s'H1:eqB i jH2:~ InA x sH3:equivlistA s' (x :: s)eqB (fold_right f i s') (fold_right f j (x :: s))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (x : A) (l : list A), {InA x l} + {~ InA x l}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (x : A) (l : list A), {InA x l} + {~ InA x l}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x:A{InA x nil} + {~ InA x nil}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:{InA x l} + {~ InA x l}{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x:A~ InA x nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:{InA x l} + {~ InA x l}{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:{InA x l} + {~ InA x l}{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:{InA x l} + {~ InA x l}e:eqA x a{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:{InA x l} + {~ InA x l}n:~ eqA x a{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:{InA x l} + {~ InA x l}n:~ eqA x a{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list Ai:InA x ln:~ eqA x a{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list An0:~ InA x ln:~ eqA x a{InA x (a :: l)} + {~ InA x (a :: l)}right; intro; inv; contradiction. Defined. Fixpoint removeA (x : A) (l : list A) : list A := match l with | nil => nil | y::tl => if (eqA_dec x y) then removeA x tl else y::(removeA x tl) end.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list An0:~ InA x ln:~ eqA x a{InA x (a :: l)} + {~ InA x (a :: l)}A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (x : A) (l : list A), removeA x l = filter (fun y : A => if eqA_dec x y then false else true) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (x : A) (l : list A), removeA x l = filter (fun y : A => if eqA_dec x y then false else true) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:removeA x l = filter (fun y : A => if eqA_dec x y then false else true) l(if eqA_dec x a then removeA x l else a :: removeA x l) = (if if eqA_dec x a then false else true then a :: filter (fun y : A => if eqA_dec x y then false else true) l else filter (fun y : A => if eqA_dec x y then false else true) l)rewrite IHl; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}x, a:Al:list AIHl:removeA x l = filter (fun y : A => if eqA_dec x y then false else true) ln:~ eqA x aa :: removeA x l = a :: filter (fun y : A => if eqA_dec x y then false else true) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (l : list A) (x y : A), InA y (removeA x l) <-> InA y l /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (l : list A) (x y : A), InA y (removeA x l) <-> InA y l /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall x y : A, InA y nil <-> InA y nil /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}a:Al:list AIHl:forall x y : A, InA y (removeA x l) <-> InA y l /\ ~ eqA x yforall x y : A, InA y (if eqA_dec x a then removeA x l else a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}x, y:AInA y nil -> InA y nil /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}x, y:AInA y nil /\ ~ eqA x y -> InA y nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}a:Al:list AIHl:forall x y : A, InA y (removeA x l) <-> InA y l /\ ~ eqA x yforall x y : A, InA y (if eqA_dec x a then removeA x l else a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}x, y:AInA y nil /\ ~ eqA x y -> InA y nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}a:Al:list AIHl:forall x y : A, InA y (removeA x l) <-> InA y l /\ ~ eqA x yforall x y : A, InA y (if eqA_dec x a then removeA x l else a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}a:Al:list AIHl:forall x y : A, InA y (removeA x l) <-> InA y l /\ ~ eqA x yforall x y : A, InA y (if eqA_dec x a then removeA x l else a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AInA y (if eqA_dec x a then removeA x l else a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHeq:eqA x aInA y (removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHeq:eqA x aH:InA y (a :: l)H0:~ eqA x yInA y lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHeq:eqA x aH0:~ eqA x yH1:eqA y aInA y lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: removeA x l) <-> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: removeA x l) -> InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: l) /\ ~ eqA x y -> InA y (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:eqA y aInA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:InA y (removeA x l)InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: l) /\ ~ eqA x y -> InA y (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:eqA y a~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:InA y (removeA x l)InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: l) /\ ~ eqA x y -> InA y (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AH0:eqA y aHnot:eqA x yeqA x aA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:InA y (removeA x l)InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: l) /\ ~ eqA x y -> InA y (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:InA y (removeA x l)InA y (a :: l) /\ ~ eqA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: l) /\ ~ eqA x y -> InA y (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aInA y (a :: l) /\ ~ eqA x y -> InA y (a :: removeA x l)right; rewrite IHl; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y0 : A, {eqA x0 y0} + {~ eqA x0 y0}a:Al:list AIHl:forall x0 y0 : A, InA y0 (removeA x0 l) <-> InA y0 l /\ ~ eqA x0 y0x, y:AHnot:~ eqA x aH0:~ eqA x yH1:InA y lInA y (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (s : list A) (x : A), NoDupA s -> NoDupA (removeA x s)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (s : list A) (x : A), NoDupA s -> NoDupA (removeA x s)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Ax:AH:NoDupA nilNoDupA nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Aa:Al:list AH:forall x0 : A, NoDupA l -> NoDupA (removeA x0 l)x:AH0:NoDupA (a :: l)NoDupA (if eqA_dec x a then removeA x l else a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Aa:Al:list AH:forall x0 : A, NoDupA l -> NoDupA (removeA x0 l)x:AH0:NoDupA (a :: l)NoDupA (if eqA_dec x a then removeA x l else a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Aa:Al:list AH:forall x0 : A, NoDupA l -> NoDupA (removeA x0 l)x:AH1:~ InA a lH2:NoDupA lNoDupA (if eqA_dec x a then removeA x l else a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Aa:Al:list AH:forall x0 : A, NoDupA l -> NoDupA (removeA x0 l)x:AH1:~ InA a lH2:NoDupA ln:~ eqA x aNoDupA (a :: removeA x l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Aa:Al:list AH:forall x0 : A, NoDupA l -> NoDupA (removeA x0 l)x:AH1:~ InA a lH2:NoDupA ln:~ eqA x a~ InA a (removeA x l)intuition. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x0 y : A, {eqA x0 y} + {~ eqA x0 y}s:list Aa:Al:list AH:forall x0 : A, NoDupA l -> NoDupA (removeA x0 l)x:AH1:~ InA a lH2:NoDupA ln:~ eqA x a~ (InA a l /\ ~ eqA x a)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (l l' : list A) (x : A), ~ InA x l -> equivlistA (x :: l) l' -> equivlistA l (removeA x l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (l l' : list A) (x : A), ~ InA x l -> equivlistA (x :: l) l' -> equivlistA l (removeA x l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AInA x0 l <-> InA x0 (removeA x l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AInA x0 l <-> InA x0 l' /\ ~ eqA x x0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 lInA x0 l' /\ ~ eqA x x0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 l' /\ ~ eqA x x0InA x0 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 l~ eqA x x0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 l' /\ ~ eqA x x0InA x0 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 lH:eqA x x0InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 l' /\ ~ eqA x x0InA x0 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 l' /\ ~ eqA x x0InA x0 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 (x :: l) /\ ~ eqA x x0InA x0 lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH1:InA x0 (x :: l)H2:~ eqA x x0InA x0 lelim H2; auto. Qed. End Remove.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x1 y : A, {eqA x1 y} + {~ eqA x1 y}l, l':list Ax:AH:~ InA x lH0:forall x1 : A, InA x1 (x :: l) <-> InA x1 l'x0:AH2:~ eqA x x0H3:eqA x0 xInA x0 l
Results concerning lists modulo eqA and ltA
Variable ltA : A -> A -> Prop. Hypothesis ltA_strorder : StrictOrder ltA. Hypothesis ltA_compat : Proper (eqA==>eqA==>iff) ltA. Let sotrans := (@StrictOrder_Transitive _ _ ltA_strorder). Hint Resolve sotrans : core. Notation InfA:=(lelistA ltA). Notation SortA:=(sort ltA). Hint Constructors lelistA sort : core.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x y : A), ltA x y -> InfA y l -> InfA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x y : A), ltA x y -> InfA y l -> InfA x linv; eauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list Ax, y:AH:ltA x yH0:InfA y (a :: l)ltA x aA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAProper (eqA ==> eqlistA ==> iff) InfAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAProper (eqA ==> eqlistA ==> iff) InfAA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list AHll':eqlistA l l'InfA x l <-> InfA x' l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list AInfA x nil <-> InfA x' nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list Ax0, x'0:Al0, l'0:list AH:eqA x0 x'0H0:eqlistA l0 l'0InfA x (x0 :: l0) <-> InfA x' (x'0 :: l'0)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list Ax0, x'0:Al0, l'0:list AH:eqA x0 x'0H0:eqlistA l0 l'0InfA x (x0 :: l0) <-> InfA x' (x'0 :: l'0)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list Ax0, x'0:Al0, l'0:list AH:eqA x0 x'0H0:eqlistA l0 l'0H2:ltA x x0ltA x' x'0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list Ax0, x'0:Al0, l'0:list AH:eqA x0 x'0H0:eqlistA l0 l'0H2:ltA x' x'0ltA x x0rewrite Hxx', H; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':AHxx':eqA x x'l, l':list Ax0, x'0:Al0, l'0:list AH:eqA x0 x'0H0:eqlistA l0 l'0H2:ltA x' x'0ltA x x0
For compatibility, can be deduced from InfA_compat
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax, y:AeqA x y -> InfA y l -> InfA x lintros H; now rewrite H. Qed. Hint Immediate InfA_ltA InfA_eqA : core.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax, y:AeqA x y -> InfA y l -> InfA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x a : A), SortA l -> InfA a l -> InA x l -> ltA a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x a : A), SortA l -> InfA a l -> InA x l -> ltA a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aforall x a : A, SortA nil -> InfA a nil -> InA x nil -> ltA a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aforall (a : A) (l0 : list A), (forall x a0 : A, SortA l0 -> InfA a0 l0 -> InA x l0 -> ltA a0 x) -> forall x a0 : A, SortA (a :: l0) -> InfA a0 (a :: l0) -> InA x (a :: l0) -> ltA a0 xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax, a:AH:SortA nilH0:InfA a nilH1:InA x nilltA a xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aforall (a : A) (l0 : list A), (forall x a0 : A, SortA l0 -> InfA a0 l0 -> InA x l0 -> ltA a0 x) -> forall x a0 : A, SortA (a :: l0) -> InfA a0 (a :: l0) -> InA x (a :: l0) -> ltA a0 xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aforall (a : A) (l0 : list A), (forall x a0 : A, SortA l0 -> InfA a0 l0 -> InA x l0 -> ltA a0 x) -> forall x a0 : A, SortA (a :: l0) -> InfA a0 (a :: l0) -> InA x (a :: l0) -> ltA a0 xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aa:Al0:list AH:forall x0 a1 : A, SortA l0 -> InfA a1 l0 -> InA x0 l0 -> ltA a1 x0x, a0:AH0:SortA (a :: l0)H1:InfA a0 (a :: l0)H2:InA x (a :: l0)ltA a0 xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aa:Al0:list AH:forall x0 a1 : A, SortA l0 -> InfA a1 l0 -> InA x0 l0 -> ltA a1 x0x, a0:AH3:eqA x aH2:SortA l0H4:InfA a l0H0:ltA a0 altA a0 xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aa:Al0:list AH:forall x0 a1 : A, SortA l0 -> InfA a1 l0 -> InA x0 l0 -> ltA a1 x0x, a0:AH3:InA x l0H2:SortA l0H4:InfA a l0H0:ltA a0 altA a0 xeauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aa:Al0:list AH:forall x0 a1 : A, SortA l0 -> InfA a1 l0 -> InA x0 l0 -> ltA a1 x0x, a0:AH3:InA x l0H2:SortA l0H4:InfA a l0H0:ltA a0 altA a0 xA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x : A), (forall y : A, In y l -> ltA x y) -> InfA x lsimple induction l; simpl; intros; constructor; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x : A), (forall y : A, In y l -> ltA x y) -> InfA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x : A), (forall y : A, InA y l -> ltA x y) -> InfA x lsimple induction l; simpl; intros; constructor; auto. Qed. (* In fact, this may be used as an alternative definition for InfA: *)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x : A), (forall y : A, InA y l -> ltA x y) -> InfA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x : A), SortA l -> InfA x l <-> (forall y : A, InA y l -> ltA x y)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l : list A) (x : A), SortA l -> InfA x l <-> (forall y : A, InA y l -> ltA x y)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:AH:SortA lInfA x l -> forall y : A, InA y l -> ltA x yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:AH:SortA l(forall y : A, InA y l -> ltA x y) -> InfA x lapply InA_InfA. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:AH:SortA l(forall y : A, InA y l -> ltA x y) -> InfA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l1 l2 : list A) (a : A), InfA a l1 -> InfA a l2 -> InfA a (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (l1 l2 : list A) (a : A), InfA a l1 -> InfA a l2 -> InfA a (l1 ++ l2)intros; inv; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al1:list AIHl1:forall (l2 : list A) (a0 : A), InfA a0 l1 -> InfA a0 l2 -> InfA a0 (l1 ++ l2)forall (l2 : list A) (a0 : A), InfA a0 (a :: l1) -> InfA a0 l2 -> InfA a0 (a :: l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l2 : list A, SortA l1 -> SortA l2 -> (forall x y : A, InA x l1 -> InA y l2 -> ltA x y) -> SortA (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l2 : list A, SortA l1 -> SortA l2 -> (forall x y : A, InA x l1 -> InA y l2 -> ltA x y) -> SortA (l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al1:list AIHl1:forall l0 : list A, SortA l1 -> SortA l0 -> (forall x y : A, InA x l1 -> InA y l0 -> ltA x y) -> SortA (l1 ++ l0)l2:list AH:SortA (a :: l1)H0:SortA l2H1:forall x y : A, InA x (a :: l1) -> InA y l2 -> ltA x ySortA (a :: l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al1:list AIHl1:forall l0 : list A, SortA l1 -> SortA l0 -> (forall x y : A, InA x l1 -> InA y l0 -> ltA x y) -> SortA (l1 ++ l0)l2:list AH0:SortA l2H1:forall x y : A, InA x (a :: l1) -> InA y l2 -> ltA x yH2:SortA l1H3:InfA a l1SortA (a :: l1 ++ l2)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al1:list AIHl1:forall l0 : list A, SortA l1 -> SortA l0 -> (forall x y : A, InA x l1 -> InA y l0 -> ltA x y) -> SortA (l1 ++ l0)l2:list AH0:SortA l2H1:forall x y : A, InA x (a :: l1) -> InA y l2 -> ltA x yH2:SortA l1H3:InfA a l1InfA a (l1 ++ l2)destruct l2; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al1:list AIHl1:forall l0 : list A, SortA l1 -> SortA l0 -> (forall x y : A, InA x l1 -> InA y l0 -> ltA x y) -> SortA (l1 ++ l0)l2:list AH0:SortA l2H1:forall x y : A, InA x (a :: l1) -> InA y l2 -> ltA x yH2:SortA l1H3:InfA a l1InfA a l2A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l : list A, SortA l -> NoDupA lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l : list A, SortA l -> NoDupA lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Aforall (a : A) (l0 : list A), (SortA l0 -> NoDupA l0) -> SortA (a :: l0) -> NoDupA (a :: l0)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:Al':list AH:SortA l' -> NoDupA l'H0:SortA (x :: l')NoDupA (x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:Al':list AH:SortA l' -> NoDupA l'H1:SortA l'H2:InfA x l'NoDupA (x :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:Al':list AH:SortA l' -> NoDupA l'H1:SortA l'H2:InfA x l'~ InA x l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:Al':list AH:SortA l' -> NoDupA l'H1:SortA l'H2:InfA x l'H0:InA x l'Falseeapply SortA_InfA_InA; eauto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAl:list Ax:Al':list AH:SortA l' -> NoDupA l'H1:SortA l'H2:InfA x l'H0:InA x l'ltA x x
Some results about eqlistA
Section EqlistA.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l l' : list A, eqlistA l l' -> length l = length l'induction 1; auto; simpl; congruence. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l l' : list A, eqlistA l l' -> length l = length l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAProper (eqlistA ==> eqlistA ==> eqlistA) (app (A:=A))repeat red; induction 1; simpl; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAProper (eqlistA ==> eqlistA ==> eqlistA) (app (A:=A))
For compatibility, can be deduced from app_eqlistA_compat
A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l1' l2 l2' : list A, eqlistA l1 l1' -> eqlistA l2 l2' -> eqlistA (l1 ++ l2) (l1' ++ l2')intros l1 l1' l2 l2' H H'; rewrite H, H'; reflexivity. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l1' l2 l2' : list A, eqlistA l1 l1' -> eqlistA l2 l2' -> eqlistA (l1 ++ l2) (l1' ++ l2')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l1' : list A, eqlistA l1 l1' -> forall l2 l2' : list A, eqlistA l2 l2' -> eqlistA (rev l1 ++ l2) (rev l1' ++ l2')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l1' : list A, eqlistA l1 l1' -> forall l2 l2' : list A, eqlistA l2 l2' -> eqlistA (rev l1 ++ l2) (rev l1' ++ l2')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:forall l2 l2' : list A, eqlistA l2 l2' -> eqlistA (rev l ++ l2) (rev l' ++ l2')forall l2 l2' : list A, eqlistA l2 l2' -> eqlistA (rev (x :: l) ++ l2) (rev (x' :: l') ++ l2')do 2 rewrite app_ass; simpl; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, x':Al, l':list AH:eqA x x'H0:eqlistA l l'IHeqlistA:forall l0 l2'0 : list A, eqlistA l0 l2'0 -> eqlistA (rev l ++ l0) (rev l' ++ l2'0)l2, l2':list AH1:eqlistA l2 l2'eqlistA ((rev l ++ x :: nil) ++ l2) ((rev l' ++ x' :: nil) ++ l2')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAProper (eqlistA ==> eqlistA) (rev (A:=A))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAProper (eqlistA ==> eqlistA) (rev (A:=A))A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall x y : list A, eqlistA x y -> eqlistA (rev x) (rev y)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, y:list AH:eqlistA x yeqlistA (rev x) (rev y)apply eqlistA_rev_app; auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAx, y:list AH:eqlistA x yeqlistA (rev x ++ nil) (rev y ++ nil)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l1' : list A, eqlistA l1 l1' -> eqlistA (rev l1) (rev l1')apply rev_eqlistA_compat. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l1 l1' : list A, eqlistA l1 l1' -> eqlistA (rev l1) (rev l1')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l l' : list A, SortA l -> SortA l' -> equivlistA l l' -> eqlistA l l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall l l' : list A, SortA l -> SortA l' -> equivlistA l l' -> eqlistA l l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al':list AH:SortA nilH0:SortA (a :: l')H1:equivlistA nil (a :: l')eqlistA nil (a :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l' : list A, SortA l -> SortA l' -> equivlistA l l' -> eqlistA l l'H:SortA (a :: l)H0:SortA nilH1:equivlistA (a :: l) nileqlistA (a :: l) nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH:SortA (a :: l)H0:SortA (a0 :: l')H1:equivlistA (a :: l) (a0 :: l')eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l' : list A, SortA l -> SortA l' -> equivlistA l l' -> eqlistA l l'H:SortA (a :: l)H0:SortA nilH1:equivlistA (a :: l) nileqlistA (a :: l) nilA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH:SortA (a :: l)H0:SortA (a0 :: l')H1:equivlistA (a :: l) (a0 :: l')eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH:SortA (a :: l)H0:SortA (a0 :: l')H1:equivlistA (a :: l) (a0 :: l')eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a leqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a lforall y : A, InA y l -> ltA a yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a lH:forall y : A, InA y l -> ltA a yeqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a lH:forall y : A, InA y l -> ltA a yeqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a lH:forall y : A, InA y l -> ltA a yforall y : A, InA y l' -> ltA a0 yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yeqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H3:InfA a0 l'H0:SortA lH4:InfA a lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yeqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yeqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yeqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:InA a (a :: l) -> InA a (a0 :: l')H4:InA a (a0 :: l') -> InA a (a :: l)eqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:InA a (a :: l) -> InA a (a0 :: l')H4:InA a (a0 :: l') -> InA a (a :: l)H6:InA a0 (a :: l) -> InA a0 (a0 :: l')H7:InA a0 (a0 :: l') -> InA a0 (a :: l)eqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:InA a (a :: l) -> InA a (a0 :: l')H4:InA a (a0 :: l') -> InA a (a :: l)H6:InA a0 (a :: l) -> InA a0 (a0 :: l')H7:InA a0 (a0 :: l') -> InA a0 (a :: l)H8:InA a (a0 :: l')eqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:InA a (a :: l) -> InA a (a0 :: l')H4:InA a (a0 :: l') -> InA a (a :: l)H6:InA a0 (a :: l) -> InA a0 (a0 :: l')H7:InA a0 (a0 :: l') -> InA a0 (a :: l)H9:InA a l'eqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:InA a (a :: l) -> InA a (a0 :: l')H4:InA a (a0 :: l') -> InA a (a :: l)H6:InA a0 (a :: l) -> InA a0 (a0 :: l')H7:InA a0 (a0 :: l') -> InA a0 (a :: l)H9:InA a l'H8:InA a0 (a :: l)eqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:InA a (a :: l) -> InA a (a0 :: l')H4:InA a (a0 :: l') -> InA a (a :: l)H6:InA a0 (a :: l) -> InA a0 (a0 :: l')H7:InA a0 (a0 :: l') -> InA a0 (a :: l)H9:InA a l'H10:InA a0 leqA a a0A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA (a :: l) (a0 :: l')A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0eqlistA l l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0equivlistA l l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x lInA x l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x lH6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)InA x l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x lH6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)H8:InA x (a0 :: l')InA x l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x lH6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)H9:eqA x a0InA x l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA a lH6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)H9:eqA x a0InA x l'A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'H6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'H6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)H8:InA x (a :: l)InA x lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA x l'H6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)H9:eqA x aInA x lelim (StrictOrder_Irreflexive a0); eauto. Qed. End EqlistA.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAa:Al:list AIHl:forall l'0 : list A, SortA l -> SortA l'0 -> equivlistA l l'0 -> eqlistA l l'0a0:Al':list AH1:equivlistA (a :: l) (a0 :: l')H2:SortA l'H0:SortA lH:forall y : A, InA y l -> ltA a yH5:forall y : A, InA y l' -> ltA a0 yH3:eqA a a0x:AH4:InA a0 l'H6:InA x (a :: l) -> InA x (a0 :: l')H7:InA x (a0 :: l') -> InA x (a :: l)H9:eqA x aInA x l
A few things about filter
Section Filter.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (f : A -> bool) (l : list A), SortA l -> SortA (filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall (f : A -> bool) (l : list A), SortA l -> SortA (filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)SortA (a :: l) -> SortA (if f a then a :: filter f l else filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)H0:SortA lH1:InfA a lSortA (if f a then a :: filter f l else filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)H0:SortA lH1:InfA a lSortA (a :: filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)H0:SortA lH1:InfA a lInfA a (filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)H0:SortA lH1:InfA a lforall y : A, In y (filter f l) -> ltA a yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)H0:SortA lH1:InfA a ly:AH:In y (filter f l)ltA a yeapply SortA_InfA_InA; eauto. Qed. Arguments eq {A} x _.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boola:Al:list AIHl:SortA l -> SortA (filter f l)H0:SortA lH1:InfA a ly:AH:In y lH2:f y = trueltA a yA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall f : A -> bool, Proper (eqA ==> eq) f -> forall (l : list A) (x : A), InA x (filter f l) <-> InA x l /\ f x = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall f : A -> bool, Proper (eqA ==> eq) f -> forall (l : list A) (x : A), InA x (filter f l) <-> InA x l /\ f x = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAforall f : A -> bool, Proper (eqA ==> eq) f -> forall (l : list A) (x : A), InA x (filter f l) <-> InA x l /\ f x = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH0:exists y : A, eqA x y /\ In y (filter f l)exists y : A, eqA x y /\ In y lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH0:exists y : A, eqA x y /\ In y (filter f l)f x = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH1:exists y : A, eqA x y /\ In y lH2:f x = trueexists y : A, eqA x y /\ In y (filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH0:exists y : A, eqA x y /\ In y (filter f l)f x = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH1:exists y : A, eqA x y /\ In y lH2:f x = trueexists y : A, eqA x y /\ In y (filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax, y:AH0:eqA x yH2:In y lH3:f y = truef x = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH1:exists y : A, eqA x y /\ In y lH2:f x = trueexists y : A, eqA x y /\ In y (filter f l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax:AH1:exists y : A, eqA x y /\ In y lH2:f x = trueexists y : A, eqA x y /\ In y (filter f l)rewrite <- (H _ _ H0); auto. Qed.A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAf:A -> boolH:Proper (eqA ==> eq) fl:list Ax, y:AH0:eqA x yH1:In y lH2:f x = truef y = trueA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall f : A -> bool, (forall x y : A, f x = true -> f y = false -> ltA x y) -> forall l : list A, SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAforall f : A -> bool, (forall x y : A, f x = true -> f y = false -> ltA x y) -> forall l : list A, SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH0:SortA (a :: l)a :: l = (if f a then a :: filter f l else filter f l) ++ (if negb (f a) then a :: filter (fun x : A => negb (f x)) l else filter (fun x : A => negb (f x)) l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a la :: l = (if f a then a :: filter f l else filter f l) ++ (if negb (f a) then a :: filter (fun x : A => negb (f x)) l else filter (fun x : A => negb (f x)) l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a la :: filter f l ++ filter (fun x : A => negb (f x)) l = (if f a then a :: filter f l else filter f l) ++ (if negb (f a) then a :: filter (fun x : A => negb (f x)) l else filter (fun x : A => negb (f x)) l)A:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseforall e : A, In e l -> f e = falseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falsee:AH3:In e lf e = falseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falsee:AH3:In e lH4:ltA a ef e = falseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falsee:AH3:In e lH4:ltA a eH5:f e = truetrue = falseA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falsee:AH3:In e lH4:ltA a eH5:f e = trueltA e eA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsea :: filter f l ++ filter (fun x : A => negb (f x)) l = filter f l ++ a :: filter (fun x : A => negb (f x)) lA:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAltA:A -> A -> PropltA_strorder:StrictOrder ltAltA_compat:Proper (eqA ==> eqA ==> iff) ltAsotrans:=StrictOrder_Transitive:Transitive ltAf:A -> boolH:forall x y : A, f x = true -> f y = false -> ltA x ya:Al:list AIHl:SortA l -> l = filter f l ++ filter (fun x : A => negb (f x)) lH1:SortA lH2:InfA a lH0:f a = falseH3:forall e : A, In e l -> f e = falsenil = filter f lA:Typef:A -> boola:Al:list AIHl:(forall e : A, In e l -> f e = false) -> nil = filter f l(forall e : A, a = e \/ In e l -> f e = false) -> nil = (if f a then a :: filter f l else filter f l)rewrite H3 in H; auto; try discriminate. Qed. End Filter. End Type_with_equality. Hint Constructors InA eqlistA NoDupA sort lelistA : core. Arguments equivlistA_cons_nil {A} eqA {eqA_equiv} x l _. Arguments equivlistA_nil_eq {A} eqA {eqA_equiv} l _. Section Find. Variable A B : Type. Variable eqA : A -> A -> Prop. Hypothesis eqA_equiv : Equivalence eqA. Hypothesis eqA_dec : forall x y : A, {eqA x y}+{~(eqA x y)}. Fixpoint findA (f : A -> bool) (l:list (A*B)) : option B := match l with | nil => None | (a,b)::l => if f a then Some b else findA f l end.A:Typef:A -> boola:Al:list AIHl:(forall e : A, In e l -> f e = false) -> nil = filter f lH:f a = trueH3:forall e : A, a = e \/ In e l -> f e = falsenil = a :: filter f lA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (l : list (A * B)) (a : A) (b : B), NoDupA (fun p p' : A * B => eqA (fst p) (fst p')) l -> InA (fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p') (a, b) l <-> findA (fun a' : A => if eqA_dec a a' then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}forall (l : list (A * B)) (a : A) (b : B), NoDupA (fun p p' : A * B => eqA (fst p) (fst p')) l -> InA (fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p') (a, b) l <-> findA (fun a' : A => if eqA_dec a a' then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propforall (l : list (A * B)) (a : A) (b : B), NoDupA eqk l -> InA (fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p') (a, b) l <-> findA (fun a' : A => if eqA_dec a a' then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propforall (l : list (A * B)) (a : A) (b : B), NoDupA eqk l -> InA eqke (a, b) l <-> findA (fun a' : A => if eqA_dec a a' then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa:Ab:BH:NoDupA eqk nilInA eqke (a, b) nil <-> None = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa:(A * B)%typel:list (A * B)IHl:forall (a1 : A) (b0 : B), NoDupA eqk l -> InA eqke (a1, b0) l <-> findA (fun a' : A => if eqA_dec a1 a' then true else false) l = Some b0a0:Ab:BH:NoDupA eqk (a :: l)InA eqke (a0, b) (a :: l) <-> (let (a1, b0) := a in if if eqA_dec a0 a1 then true else false then Some b0 else findA (fun a' : A => if eqA_dec a0 a' then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa:Ab:BH:NoDupA eqk nilH0:InA eqke (a, b) nilNone = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa:(A * B)%typel:list (A * B)IHl:forall (a1 : A) (b0 : B), NoDupA eqk l -> InA eqke (a1, b0) l <-> findA (fun a' : A => if eqA_dec a1 a' then true else false) l = Some b0a0:Ab:BH:NoDupA eqk (a :: l)InA eqke (a0, b) (a :: l) <-> (let (a1, b0) := a in if if eqA_dec a0 a1 then true else false then Some b0 else findA (fun a' : A => if eqA_dec a0 a' then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa:(A * B)%typel:list (A * B)IHl:forall (a1 : A) (b0 : B), NoDupA eqk l -> InA eqke (a1, b0) l <-> findA (fun a' : A => if eqA_dec a1 a' then true else false) l = Some b0a0:Ab:BH:NoDupA eqk (a :: l)InA eqke (a0, b) (a :: l) <-> (let (a1, b0) := a in if if eqA_dec a0 a1 then true else false then Some b0 else findA (fun a' : A => if eqA_dec a0 a' then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH:NoDupA eqk ((a', b') :: l)InA eqke (a, b) ((a', b') :: l) <-> (if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lInA eqke (a, b) ((a', b') :: l) <-> (if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:InA eqke (a, b) ((a', b') :: l)(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:eqke (a, b) (a', b')(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) l(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:eqA a a'H2:b = b'(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) l(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Al:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b) lH1:NoDupA eqk lH:eqA a a'(if if eqA_dec a a' then true else false then Some b else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) l(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) l(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) lHeqA:eqA a a'Some b' = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH1:NoDupA eqk lH2:InA eqke (a, b) lHeqA:eqA a a'InA eqk (a', b') lA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)a:Ab:BeqA a a' -> InA eqke (a, b) l -> InA eqk (a', b') lA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba:Ab:BeqA a a' -> InA eqke (a, b) nil -> InA eqk (a', b') nilA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:(A * B)%typel:list (A * B)a:Ab:BIHl:eqA a a' -> InA eqke (a, b) l -> InA eqk (a', b') leqA a a' -> InA eqke (a, b) (a0 :: l) -> InA eqk (a', b') (a0 :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:(A * B)%typel:list (A * B)a:Ab:BIHl:eqA a a' -> InA eqke (a, b) l -> InA eqk (a', b') leqA a a' -> InA eqke (a, b) (a0 :: l) -> InA eqk (a', b') (a0 :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:(A * B)%typel:list (A * B)a:Ab:BIHl:eqA a a' -> InA eqke (a, b) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqke (a, b) a0InA eqk (a', b') (a0 :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:Ab0:Bl:list (A * B)a:Ab:BIHl:eqA a a' -> InA eqke (a, b) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqke (a, b) (a0, b0)InA eqk (a', b') ((a0, b0) :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:Ab0:Bl:list (A * B)a:Ab:BIHl:eqA a a' -> InA eqke (a, b) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqA a a0H0:b = b0InA eqk (a', b') ((a0, b0) :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:Ab0:Bl:list (A * B)a:AIHl:eqA a a' -> InA eqke (a, b0) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqA a a0InA eqk (a', b') ((a0, b0) :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:Ab0:Bl:list (A * B)a:AIHl:eqA a a' -> InA eqke (a, b0) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqA a a0eqk (a', b') (a0, b0)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:Ab0:Bl:list (A * B)a:AIHl:eqA a a' -> InA eqke (a, b0) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqA a a0eqA a' a0A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Ba0:Ab0:Bl:list (A * B)a:AIHl:eqA a a' -> InA eqke (a, b0) l -> InA eqk (a', b') lHeqA:eqA a a'H:eqA a a0eqA a' aA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH2:InA eqke (a, b) ln:~ eqA a a'findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bA, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk lH:(if if eqA_dec a a' then true else false then Some b' else findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l) = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk le:eqA a a'H:Some b' = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk ln:~ eqA a a'H:findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bInA eqke (a, b) ((a', b') :: l)A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk ln:~ eqA a a'H:findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bInA eqke (a, b) ((a', b') :: l)rewrite IHl; auto. Qed. End Find.A, B:TypeeqA:A -> A -> PropeqA_equiv:Equivalence eqAeqA_dec:forall x y : A, {eqA x y} + {~ eqA x y}eqk:=fun p p' : A * B => eqA (fst p) (fst p'):A * B -> A * B -> Propeqke:=fun p p' : A * B => eqA (fst p) (fst p') /\ snd p = snd p':A * B -> A * B -> Propa':Ab':Bl:list (A * B)IHl:forall (a0 : A) (b0 : B), NoDupA eqk l -> InA eqke (a0, b0) l <-> findA (fun a'0 : A => if eqA_dec a0 a'0 then true else false) l = Some b0a:Ab:BH0:~ InA eqk (a', b') lH1:NoDupA eqk ln:~ eqA a a'H:findA (fun a'0 : A => if eqA_dec a a'0 then true else false) l = Some bInA eqke (a, b) l
Compatibility aliases. Proper is rather to be used directly now.
Definition compat_bool {A} (eqA:A->A->Prop)(f:A->bool) := Proper (eqA==>Logic.eq) f. Definition compat_nat {A} (eqA:A->A->Prop)(f:A->nat) := Proper (eqA==>Logic.eq) f. Definition compat_P {A} (eqA:A->A->Prop)(P:A->Prop) := Proper (eqA==>impl) P. Definition compat_op {A B} (eqA:A->A->Prop)(eqB:B->B->Prop)(f:A->B->B) := Proper (eqA==>eqB==>eqB) f.