Nontrivial types #
A type is nontrivial if it contains at least two elements. This is useful in particular for rings (where it is equivalent to the fact that zero is different from one) and for vector spaces (where it is equivalent to the fact that the dimension is positive).
We introduce a typeclass Nontrivial
formalizing this property.
Basic results about nontrivial types are in Mathlib.Logic.Nontrivial.Basic
.
- exists_pair_ne : ∃ x y, x ≠ y
In a nontrivial type, there exists a pair of distinct terms.
Predicate typeclass for expressing that a type is not reduced to a single element. In rings,
this is equivalent to 0 ≠ 1
. In vector spaces, this is equivalent to positive dimension.
Instances
See Note [lower instance priority]
Note that since this and nonempty_of_inhabited
are the most "obvious" way to find a nonempty
instance if no direct instance can be found, we give this a higher priority than the usual 100
.
A type is either a subsingleton or nontrivial.
Pullback a Nontrivial
instance along a surjective function.