@@ -646,7 +676,7 @@ Inductive JMeq (A : Type) (x : A) : forall B : Type, B -> Prop :=
...
@@ -646,7 +676,7 @@ Inductive JMeq (A : Type) (x : A) : forall B : Type, B -> Prop :=
JMeq_refl:JMeqxx
JMeq_refl:JMeqxx
]]
]]
Theidentity[JMeq]standsfor%\index{JohnMajorequality}``%#"#John Major equality,#"#%''%anamecoinedbyConorMcBride%~\cite{JMeq}%asasortofpunaboutBritishpolitics.Thedefinition[JMeq]startsoutlookingalotlikethedefinitionof[eq].Thecrucialdifferenceisthatwemayuse[JMeq]_onargumentsofdifferenttypes_.Forinstance,alemmathatwefailedtoestablishbeforeistrivialwith[JMeq].Itmakesforprettiertheoremstatementstodefinesomesyntacticshorthandfirst.*)
Theidentity[JMeq]standsfor%\index{JohnMajorequality}%"John Major equality,"anamecoinedbyConorMcBride%~\cite{JMeq}%asasortofpunaboutBritishpolitics.Thedefinition[JMeq]startsoutlookingalotlikethedefinitionof[eq].Thecrucialdifferenceisthatwemayuse[JMeq]_onargumentsofdifferenttypes_.Forinstance,alemmathatwefailedtoestablishbeforeistrivialwith[JMeq].Itmakesforprettiertheoremstatementstodefinesomesyntacticshorthandfirst.*)
Infix"==":=JMeq(atlevel70,noassociativity).
Infix"==":=JMeq(atlevel70,noassociativity).
...
@@ -831,6 +861,7 @@ Theorem out_of_luck : forall n m : nat,
...
@@ -831,6 +861,7 @@ Theorem out_of_luck : forall n m : nat,
@@ -850,7 +881,7 @@ In other words, the successor function [S] is insufficiently polymorphic. If we
...
@@ -850,7 +881,7 @@ In other words, the successor function [S] is insufficiently polymorphic. If we
Abort.
Abort.
(**Whydidwenotrunintothisprobleminourproofof[fhapp_ass'']?Thereasonisthatthepairconstructorispolymorphicinthetypesofthepaircomponents,whilefunctionslike[S]arenotpolymorphicatall.Useofsuchnon-polymorphicfunctionswith[JMeq]tendstopushtowarduseofaxioms.Theexamplewith[nat]hereisabitunrealistic;morelikelycaseswouldinvolvefunctionsthathave_some_polymorphism,butnotenoughtoallowabstractionsofthesortweattemptedabovewith[pattern].Forinstance,wemighthaveanequalitybetweentwolists,wherethegoalonlytype-checkswhenthetermsinvolvedreallyarelists,thougheverythingispolymorphicinthetypesoflistdataelements.The#<ahref="http://www.mpi-sws.org/~gil/Heq/">#Heq%\footnote{\url{http://www.mpi-sws.org/~gil/Heq/}}%#</a># library builds up a slightly different foundation to help avoid such problems. *)
(**Whydidwenotrunintothisprobleminourproofof[fhapp_ass'']?Thereasonisthatthepairconstructorispolymorphicinthetypesofthepaircomponents,whilefunctionslike[S]arenotpolymorphicatall.Useofsuchnon-polymorphicfunctionswith[JMeq]tendstopushtowarduseofaxioms.Theexamplewith[nat]hereisabitunrealistic;morelikelycaseswouldinvolvefunctionsthathave_some_polymorphism,butnotenoughtoallowabstractionsofthesortweattemptedabovewith[pattern].Forinstance,wemighthaveanequalitybetweentwolists,wherethegoalonlytype-checkswhenthetermsinvolvedreallyarelists,thougheverythingispolymorphicinthetypesoflistdataelements.The{{http://www.mpi-sws.org/~gil/Heq/}Heq} library builds up a slightly different foundation to help avoid such problems. *)
(***EquivalenceofEqualityAxioms*)
(***EquivalenceofEqualityAxioms*)
...
@@ -873,11 +904,12 @@ Definition JMeq' (A : Type) (x : A) (B : Type) (y : B) : Prop :=
...
@@ -873,11 +904,12 @@ Definition JMeq' (A : Type) (x : A) (B : Type) (y : B) : Prop :=