From cb2cfc0bf608a45c5a9948152aae55ce455c4e14 Mon Sep 17 00:00:00 2001 From: Malte Isberner Date: Mon, 21 Jul 2014 22:10:09 -0700 Subject: [backport] Fixed mathematically wrong statement in the documentation of scala.math.PartialOrdering. - Previous (misleading) documentation suggested that a partial ordering *is* an equivalence relation. This has now been clarified. - Existing documentation on properties of partial orderings (reflexive, transitive, antisymmetric) had several formatting inconsistencies that have now been remove. (cherry picked from commit 528df5becee03175e7462b64d7c22460cc5992f7) --- src/library/scala/math/PartialOrdering.scala | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/math/PartialOrdering.scala b/src/library/scala/math/PartialOrdering.scala index 9e35381528..8d7fc32535 100644 --- a/src/library/scala/math/PartialOrdering.scala +++ b/src/library/scala/math/PartialOrdering.scala @@ -15,17 +15,24 @@ package math * latter. * * A [[http://en.wikipedia.org/wiki/Partial_order partial ordering]] is a - * binary relation on a type `T` that is also an equivalence relation on - * values of type `T`. This relation is exposed as the `lteq` method of - * the `PartialOrdering` trait. This relation must be: + * binary relation on a type `T`, exposed as the `lteq` method of this trait. + * This relation must be: * * - reflexive: `lteq(x, x) == '''true'''`, for any `x` of type `T`. - * - anti-symmetric: `lteq(x, y) == '''true'''` and `lteq(y, x) == true` - * then `equiv(x, y)`, for any `x` and `y` of type `T`. + * - anti-symmetric: if `lteq(x, y) == '''true'''` and + * `lteq(y, x) == '''true'''` + * then `equiv(x, y) == '''true'''`, for any `x` and `y` of type `T`. * - transitive: if `lteq(x, y) == '''true'''` and * `lteq(y, z) == '''true'''` then `lteq(x, z) == '''true'''`, * for any `x`, `y`, and `z` of type `T`. * + * Additionally, a partial ordering induces an + * [[http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]] + * on a type `T`: `x` and `y` of type `T` are equivalent if and only if + * `lteq(x, y) && lteq(y, x) == '''true'''`. This equivalence relation is + * exposed as the `equiv` method, inherited from the + * [[scala.math.Equiv Equiv]] trait. + * * @author Geoffrey Washburn * @version 1.0, 2008-04-0-3 * @since 2.7 -- cgit v1.2.3