Skip to content
LeanLearn
Level 2~30 minLean 4

Relations: equivalence and order

Toggle pairs in a grid and discover the four properties that turn a relation into an equivalence (like 'same remainder') or an order (like 'divides'). Then prove an equivalence in Lean.

You will be able to
  • Represent a relation as a set of ordered pairs, a grid and an arrow diagram.
  • Decide whether a relation is reflexive, symmetric, antisymmetric or transitive, and name the pairs that break a property.
  • Recognise equivalence relations, their classes, and partial orders.
  • Prove that an equality-based relation is an equivalence in Lean.

Recommended first: Functions: one-to-one, onto, and both. You can start anyway. Nothing is locked.

EncounterActivity 1 of 8

Encounter

"Is the same age as", "is a sibling of", "divides", "is less than": these are relations. A relation RR on a set says, for each pair (a,b)(a, b), whether aa is related to bb. We write a R ba\,R\,b. Formally, a relation is just a set of ordered pairs.

A function is a special relation: each input is related to exactly one output. General relations have no such rule: an element may be related to many others, or to none.

Four properties matter most:

PropertyMeaningTo break it, show…
reflexive∀a,  a R a\forall a,\; a\,R\,aone aa not related to itself
symmetrica R b→b R aa\,R\,b \to b\,R\,aa pair (a,b)(a,b) without (b,a)(b,a)
antisymmetrica R b∧b R a→a=ba\,R\,b \land b\,R\,a \to a = btwo different elements related both ways
transitivea R b∧b R c→a R ca\,R\,b \land b\,R\,c \to a\,R\,c(a,b)(a,b) and (b,c)(b,c) without (a,c)(a,c)