Skip to content
LeanLearn
Level 1~25 minLean 4

Functions: one-to-one, onto, and both

Draw arrows from inputs to outputs and discover what makes a mapping a function, and when it is injective, surjective or bijective.

You will be able to
  • Decide whether a mapping is a function.
  • Recognise injective, surjective and bijective functions, with evidence when a property fails.
  • State injectivity and surjectivity with quantifiers, and prove an injectivity claim in Lean.

Recommended first: Sets, membership and Venn diagrams. You can start anyway. Nothing is locked.

EncounterActivity 1 of 10

Encounter

A function is a rule that takes an input and gives back exactly one output. A vending machine is a good picture: press a button (input), get a snack (output). Pressing the same button always gives the same snack, and every button gives something.

We write f:A→Bf : A \to B for a function from the set AA (the domain, all allowed inputs) to the set BB (the codomain, all allowed outputs). Lean uses the very same arrow: f : Nat → Nat is a function from numbers to numbers.