comparison src/Universes.v @ 437:8077352044b2

A pass over all formatting, after big pile of coqdoc changes
author Adam Chlipala <adam@chlipala.net>
date Fri, 27 Jul 2012 16:47:28 -0400
parents 5d5e44f905c7
children 0d66f1a710b8
comparison
equal deleted inserted replaced
436:5d5e44f905c7 437:8077352044b2
270 The command outputs many more constraints, but we have collected only those that mention [Top] variables. We see one constraint for each universe variable associated with a constructor argument from [exp]'s definition. Universe variable [Top.19] is the type argument to [Eq]. The constraint for [Top.19] effectively says that [Top.19] must be less than [Top.8], the universe of [exp]'s indices; an intermediate variable [Top.9] appears as an artifact of the way the constraint was generated. 270 The command outputs many more constraints, but we have collected only those that mention [Top] variables. We see one constraint for each universe variable associated with a constructor argument from [exp]'s definition. Universe variable [Top.19] is the type argument to [Eq]. The constraint for [Top.19] effectively says that [Top.19] must be less than [Top.8], the universe of [exp]'s indices; an intermediate variable [Top.9] appears as an artifact of the way the constraint was generated.
271 271
272 The next constraint, for [Top.15], is more complicated. This is the universe of the second argument to the [Pair] constructor. Not only must [Top.15] be less than [Top.8], but it also comes out that [Top.8] must be less than [Coq.Init.Datatypes.38]. What is this new universe variable? It is from the definition of the [prod] inductive family, to which types of the form [A * B] are desugared. *) 272 The next constraint, for [Top.15], is more complicated. This is the universe of the second argument to the [Pair] constructor. Not only must [Top.15] be less than [Top.8], but it also comes out that [Top.8] must be less than [Coq.Init.Datatypes.38]. What is this new universe variable? It is from the definition of the [prod] inductive family, to which types of the form [A * B] are desugared. *)
273 273
274 (* begin hide *) 274 (* begin hide *)
275 (* begin thide *)
275 Inductive prod := pair. 276 Inductive prod := pair.
276 Reset prod. 277 Reset prod.
278 (* end thide *)
277 (* end hide *) 279 (* end hide *)
278 280
279 (** [[ 281 (** [[
280 Print prod. 282 Print prod.
281 ]] 283 ]]
475 match x with 477 match x with
476 | exist v _ => v 478 | exist v _ => v
477 end. 479 end.
478 480
479 (* begin hide *) 481 (* begin hide *)
482 (* begin thide *)
480 Definition projE := O. 483 Definition projE := O.
484 (* end thide *)
481 (* end hide *) 485 (* end hide *)
482 486
483 (** We run into trouble with a version that has been changed to work with [ex]. 487 (** We run into trouble with a version that has been changed to work with [ex].
484 [[ 488 [[
485 Definition projE A (P : A -> Prop) (x : ex P) : A := 489 Definition projE A (P : A -> Prop) (x : ex P) : A :=
775 | [ |- ?pf1 = ?pf2 ] => rewrite (UIP_refl pf1); rewrite (UIP_refl pf2); reflexivity 779 | [ |- ?pf1 = ?pf2 ] => rewrite (UIP_refl pf1); rewrite (UIP_refl pf2); reflexivity
776 end. 780 end.
777 Qed. 781 Qed.
778 782
779 (* begin hide *) 783 (* begin hide *)
784 (* begin thide *)
780 Require Eqdep_dec. 785 Require Eqdep_dec.
786 (* end thide *)
781 (* end hide *) 787 (* end hide *)
782 788
783 (** These corollaries are special cases of proof irrelevance. In developments that only need proof irrelevance for equality, there is no need to assert full irrelevance. 789 (** These corollaries are special cases of proof irrelevance. In developments that only need proof irrelevance for equality, there is no need to assert full irrelevance.
784 790
785 Another facet of proof irrelevance is that, like excluded middle, it is often provable for specific propositions. For instance, [UIP] is provable whenever the type [A] has a decidable equality operation. The module [Eqdep_dec] of the standard library contains a proof. A similar phenomenon applies to other notable cases, including less-than proofs. Thus, it is often possible to use proof irrelevance without asserting axioms. 791 Another facet of proof irrelevance is that, like excluded middle, it is often provable for specific propositions. For instance, [UIP] is provable whenever the type [A] has a decidable equality operation. The module [Eqdep_dec] of the standard library contains a proof. A similar phenomenon applies to other notable cases, including less-than proofs. Thus, it is often possible to use proof irrelevance without asserting axioms.
847 ]] 853 ]]
848 854
849 This axiom lets us convert a relational specification [R] into a function implementing that specification. We need only prove that [R] is truly a function. An alternate, stronger formulation applies to cases where [R] maps each input to one or more outputs. We also simplify the statement of the theorem by considering only non-dependent function types. *) 855 This axiom lets us convert a relational specification [R] into a function implementing that specification. We need only prove that [R] is truly a function. An alternate, stronger formulation applies to cases where [R] maps each input to one or more outputs. We also simplify the statement of the theorem by considering only non-dependent function types. *)
850 856
851 (* begin hide *) 857 (* begin hide *)
858 (* begin thide *)
852 Require RelationalChoice. 859 Require RelationalChoice.
860 (* end thide *)
853 (* end hide *) 861 (* end hide *)
854 862
855 Require Import ClassicalChoice. 863 Require Import ClassicalChoice.
856 Check choice. 864 Check choice.
857 (** %\vspace{-.15in}% [[ 865 (** %\vspace{-.15in}% [[
965 intros; dep_destruct f; eauto. 973 intros; dep_destruct f; eauto.
966 Qed. 974 Qed.
967 975
968 (* begin hide *) 976 (* begin hide *)
969 Require Import JMeq. 977 Require Import JMeq.
978 (* begin thide *)
970 Definition jme := (JMeq, JMeq_eq). 979 Definition jme := (JMeq, JMeq_eq).
980 (* end thide *)
971 (* end hide *) 981 (* end hide *)
972 982
973 Print Assumptions fin_cases. 983 Print Assumptions fin_cases.
974 (** %\vspace{-.15in}%[[ 984 (** %\vspace{-.15in}%[[
975 Axioms: 985 Axioms:
1086 It looks like we are almost done. Hypothesis [H1] gives [p = p0] by injectivity of constructors, and then [H] finishes the case. *) 1096 It looks like we are almost done. Hypothesis [H1] gives [p = p0] by injectivity of constructors, and then [H] finishes the case. *)
1087 1097
1088 injection H1; intros. 1098 injection H1; intros.
1089 1099
1090 (* begin hide *) 1100 (* begin hide *)
1101 (* begin thide *)
1091 Definition existT' := existT. 1102 Definition existT' := existT.
1103 (* end thide *)
1092 (* end hide *) 1104 (* end hide *)
1093 1105
1094 (** Unfortunately, the "equality" that we expected between [p] and [p0] comes in a strange form: 1106 (** Unfortunately, the "equality" that we expected between [p] and [p0] comes in a strange form:
1095 1107
1096 [[ 1108 [[