diff --git a/doc/ordinal-chapter.tex b/doc/ordinal-chapter.tex index 23d41e57..0058bae9 100644 --- a/doc/ordinal-chapter.tex +++ b/doc/ordinal-chapter.tex @@ -148,7 +148,7 @@ \section{Ordinal Notations} \end{itemize} -Such a structure may be proved correct relatively to a bigger ordinal notation or to Schütte's or \gaia's model. +Such a structure should be proved correct relatively to a bigger ordinal notation or to Schütte's or \gaia's model. @@ -159,9 +159,9 @@ \subsection{Classes for ordinal notations} From the \coq{} user's point of view, an ordinal notation is a structure allowing to compare two ordinals by computation, and proving by well-founded induction. -\subsubsection{The \texttt{Comparison} and \texttt{Comparable} classes} +\subsubsection{The \texttt{Comparable} class} -We use the operational class \texttt{Comparison} of comparison functions to define the \texttt{Comparable} class, contributed by Jérémy Damour and Théo Zimmermann, which allows us to apply generic lemmas and tactics about decidable strict orders. +The \texttt{Comparable} class, contributed by Jérémy Damour and Théo Zimmermann, allows us to apply generic lemmas and tactics about decidable strict orders. The correctness of the comparison function is expressed through Stdlib's type \texttt{Datatypes.CompareSpec} as specialized by \texttt{Datatypes.CompSpec}. @@ -213,7 +213,7 @@ \subsubsection{The \texttt{ON} class} \inputsnippets{ON_Generic/ONDefsb} \begin{remark} -The infix notations \texttt{o<} and \texttt{o<=} are defined in order to make apparent the distinction between the various notation scopes that may co-exist in a same statement. So the infix \texttt{<} and \texttt{<=} are reserved to the natural numbers. In the mathematical formulas, however, we still use $<$ and $\leq$ for comparing ordinals. +The infix notations \texttt{o<} and \texttt{o<=} are defined in order to make apparent the distinction between the various notation scopes that may co-exist in a same statement. So the infix \texttt{<} and \texttt{<=} are reserved to the natural numbers. In mathematical formulas, however, we still use $<$ and $\leq$ for inequalities between ordinals. \end{remark} @@ -250,7 +250,8 @@ \section{Example: the ordinal \texorpdfstring{$\omega$}{omega}} \vspace{4pt} \noindent\emph{From Library~\href{../theories/html/hydras.OrdinalNotations.ON_Omega.html}{OrdinalNotations.ON\_Omega}} -\inputsnippets{ON_Omega/OmegaDefa, ON_Omega/OmegaDefb} +\inputsnippets{ON_Omega/OmegaDefa} +\inputsnippets{ON_Omega/OmegaDefb} \section{Sum of two ordinal notations} @@ -409,7 +410,7 @@ \subsection{Definitions} \begin{itemize} \item A \emph{least} element is a minorant (in the large sense) of the full set on $A$, \item $y$ is a \emph{successor} of $x$ if $x,thin] (Adots) -- node [auto] {$\iota$} (Bdots); \end{scope} \end{tikzpicture} - \caption{\textcolor{blue}{$A$} is a sub-segment of \textcolor{red}{$B$}} + \caption{\textcolor{blue}{$\omega$} is a sub-segment of \textcolor{red}{$\omega+\omega$}} \label{fig:subsegment} \end{figure} diff --git a/theories/ordinals/Hydra/Omega2_Small.v b/theories/ordinals/Hydra/Omega2_Small.v index ef939b2f..87972e3e 100644 --- a/theories/ordinals/Hydra/Omega2_Small.v +++ b/theories/ordinals/Hydra/Omega2_Small.v @@ -103,9 +103,7 @@ Section Impossibility_Proof. |*) Corollary m_lt : m small_h o< m big_h. - Proof. - apply m_strict_mono with (1:=Hvar) (2:=big_to_small) . - Qed. + Proof. apply m_strict_mono with (1:=Hvar) (2:=big_to_small). Qed. (*||*) (* end snippet mLt *) diff --git a/theories/ordinals/OrdinalNotations/ON_Generic.v b/theories/ordinals/OrdinalNotations/ON_Generic.v index 18ca5fc4..7c7cb7a4 100644 --- a/theories/ordinals/OrdinalNotations/ON_Generic.v +++ b/theories/ordinals/OrdinalNotations/ON_Generic.v @@ -33,27 +33,22 @@ Section Definitions. Context {A:Type} {lt : relation A} {cmp : Compare A} {on: ON lt cmp}. - #[using="All"] - Definition ON_t := A. + #[using="All"] Definition ON_t := A. - #[using="All"] - Definition ON_compare : A -> A -> comparison := compare. + #[using="All"] Definition ON_compare : A -> A -> comparison := compare. - #[using="All"] - Definition ON_lt := lt. + #[using="All"] Definition ON_lt := lt. - #[using="All"] - Definition ON_le: relation A := leq lt. + #[using="All"] Definition ON_le: relation A := leq lt. #[using="All"] - Definition measure_lt {B : Type} (m : B -> A) : relation B := + Definition measure_lt {B : Type} (m : B -> A) : relation B := fun x y => ON_lt (m x) (m y). #[using="All"] - Lemma wf_measure {B : Type} (m : B -> A) : + Lemma wf_measure {B : Type} (m : B -> A) : well_founded (measure_lt m). (* end snippet ONDefsa *) - Proof. intro x; eapply Acc_incl with (fun x y => ON_lt (m x) (m y)). - intros y z H; apply H. @@ -96,11 +91,9 @@ Class SubON (iota: A -> B):= { SubON_compare: forall x y : A, - compareB (iota x) (iota y) = - compareA x y; + compareB (iota x) (iota y) = compareA x y; SubON_incl : forall x, ltB (iota x) alpha; - SubON_onto : forall y, - ltB y alpha -> exists x:A, iota x = y}. + SubON_onto : forall y, ltB y alpha -> exists x:A, iota x = y}. (* end snippet SubONDef *) @@ -134,7 +127,7 @@ Class ON_correct `(alpha : Ord) exists b, iota b = beta; On_compare_spec : forall a b:A, match compareA a b with - Datatypes.Lt => lt (iota a) (iota b) + | Datatypes.Lt => lt (iota a) (iota b) | Datatypes.Eq => iota a = iota b | Datatypes.Gt => lt (iota b) (iota a) end diff --git a/theories/ordinals/OrdinalNotations/ON_Omega.v b/theories/ordinals/OrdinalNotations/ON_Omega.v index e125d8ad..175244fb 100644 --- a/theories/ordinals/OrdinalNotations/ON_Omega.v +++ b/theories/ordinals/OrdinalNotations/ON_Omega.v @@ -12,16 +12,14 @@ Import Relations RelationClasses. Instance compare_nat : Compare nat := Nat.compare. (* begin snippet OmegaDefa:: no-out *) -#[global] - Instance Omega_comp : Comparable Peano.lt compare_nat. +#[global] Instance Omega_comp : Comparable Peano.lt compare_nat. Proof. split. - apply Nat.lt_strorder. - apply Nat.compare_spec. Qed. -#[global] - Instance Omega : ON Peano.lt compare_nat. +#[global] Instance Omega : ON Peano.lt compare_nat. Proof. split. - apply Omega_comp. diff --git a/theories/ordinals/OrdinalNotations/ON_Omega2.v b/theories/ordinals/OrdinalNotations/ON_Omega2.v index b5ecaed9..3a7ff0f7 100644 --- a/theories/ordinals/OrdinalNotations/ON_Omega2.v +++ b/theories/ordinals/OrdinalNotations/ON_Omega2.v @@ -575,7 +575,7 @@ Section Merge. {wf (measure_lt m) xys} : list A := match xys with - (nil, ys) => ys + | (nil, ys) => ys | (xs, nil) => xs | (x :: xs, y :: ys) => if ltb x y then x :: merge ltb (xs, (y :: ys)) diff --git a/theories/ordinals/Prelude/Comparable.v b/theories/ordinals/Prelude/Comparable.v index 277d421a..789a32eb 100644 --- a/theories/ordinals/Prelude/Comparable.v +++ b/theories/ordinals/Prelude/Comparable.v @@ -28,15 +28,13 @@ Section Comparable. Notation lt_irrefl := StrictOrder_Irreflexive (only parsing). (* Relation Lt *) - Lemma lt_not_gt (a b: A): - lt a b -> ~lt b a. + Lemma lt_not_gt (a b: A): lt a b -> ~lt b a. Proof. intros Hlt Hgt. apply StrictOrder_Irreflexive with a; now transitivity b. Qed. - Lemma lt_not_ge (a b: A): - lt a b -> ~ le b a. + Lemma lt_not_ge (a b: A): lt a b -> ~ le b a. Proof. intros Hlt Hle. apply le_lt_eq in Hle as [Hgt | Heq]. @@ -61,15 +59,13 @@ Section Comparable. now transitivity b. Qed. - Lemma compare_lt_irrefl (a: A): - ~compare a a = Lt. + Lemma compare_lt_irrefl (a: A): ~compare a a = Lt. Proof. intro H. now apply compare_lt_iff, StrictOrder_Irreflexive in H. Qed. - Lemma compare_eq_iff (a b: A): - compare a b = Eq <-> a = b. + Lemma compare_eq_iff (a b: A): compare a b = Eq <-> a = b. Proof. pose proof (comparable_comp_spec a b) as [Heq | H | H]; split; intro; subst; try easy;