# Documentation

Mathlib.Logic.Nontrivial.Defs

# 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.

class Nontrivial (α : Type u_3) :
• 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
theorem nontrivial_iff {α : Type u_1} :
x y, x y
theorem exists_pair_ne (α : Type u_3) [] :
x y, x y
theorem Decidable.exists_ne {α : Type u_1} [] [] (x : α) :
y, y x
theorem exists_ne {α : Type u_1} [] (x : α) :
y, y x
theorem nontrivial_of_ne {α : Type u_1} (x : α) (y : α) (h : x y) :
theorem nontrivial_iff_exists_ne {α : Type u_1} (x : α) :
y, y x
instance Nontrivial.to_nonempty {α : Type u_1} [] :

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.

theorem subsingleton_iff {α : Type u_1} :
∀ (x y : α), x = y
theorem not_nontrivial (α : Type u_3) [] :
theorem not_subsingleton (α : Type u_3) [] :
theorem subsingleton_or_nontrivial (α : Type u_3) :

A type is either a subsingleton or nontrivial.

theorem Function.Surjective.nontrivial {α : Type u_1} {β : Type u_2} [] {f : αβ} (hf : ) :

Pullback a Nontrivial instance along a surjective function.