JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Sets, Functions and the Three Kinds of Map

Sets are the nouns of analysis and functions are its verbs. Build sets and their operations, define a function as a map, and meet injections, surjections and bijections — the three properties that decide when two sets are “the same size.”

Sets and their operations

A [[ana-set|set]] is a collection of objects, its elements. We write x ∈ A for “x is in A,” and we build sets by listing, {1, 2, 3}, or by a property, {x ∈ ℝ : x² < 2}. A is a [[subset|subset]] of B (A ⊆ B) when every element of A lies in B — note this is a ∀-statement: ∀x (x ∈ A ⇒ x ∈ B). Two sets are equal exactly when A ⊆ B and B ⊆ A, which is why set equality is usually proved by double inclusion.

From two sets we form the union A ∪ B (in at least one), the intersection A ∩ B (in both), the difference A \ B (in A but not B), and the complement Aᶜ relative to a universe. Each operation is a connective in disguise: ∪ is “or,” ∩ is “and,” complement is “not.” That is why De Morgan's laws — (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ and (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ — look exactly like the quantifier-negation rules from the previous guide.

Functions as maps

A [[function-map|function]] f : A → B assigns to each element of the domain A exactly one element of the codomain B. Two demands hide here: every x must get an output (totality), and never two outputs (single-valuedness). When you define f by a formula or a rule, checking it is [[well-defined|well-defined]] means verifying both demands actually hold — for instance, a rule on fractions must give the same answer for 1/2 and 2/4.

The image f(A) = {f(x) : x ∈ A} is the set of values actually hit; it may be smaller than the codomain B. Keep domain, codomain and image distinct — much of analysis is about controlling the image of a function (its boundedness, its supremum) once the domain is pinned down.

Injection, surjection, bijection

An [[ana-injection|injection]] (one-to-one) never collapses two inputs: f(x) = f(y) ⇒ x = y. A [[surjection|surjection]] (onto) hits everything: ∀b ∈ B, ∃a ∈ A with f(a) = b — its image is all of B. A [[bijection|bijection]] is both at once, and exactly the bijections have a two-sided inverse f⁻¹. Bijections are how we make the idea of “same size” precise: A and B have the same [[cardinality|cardinality]] when some bijection runs between them. That single definition drives the entire next guide.

Sorting three maps on the natural numbers N = {0,1,2,...}.

(a) f(n) = 2n               doubling
    Injective? f(n)=f(m) => 2n=2m => n=m.  YES one-to-one.
    Surjective onto N? 3 is never hit (no n with 2n=3).  NO.
    => injection, not surjection. Image = even numbers.

(b) g(n) = floor(n/2)       0,0,1,1,2,2,...
    Injective? g(0)=g(1)=0, so two inputs collapse.  NO.
    Surjective onto N? every k = g(2k).  YES onto.
    => surjection, not injection.

(c) h(n) = n+1 on positive integers {1,2,3,...} -> {2,3,4,...}
    Injective and onto its codomain {2,3,...}.  BIJECTION.
    Inverse h^{-1}(m) = m-1.

Note (a): N is in bijection with a PROPER subset of itself
(the even numbers, via n <-> 2n). For infinite sets this is
allowed and normal -- it is exactly what "infinite" feels like.
Injective = no collisions; surjective = nothing missed; bijective = both, hence invertible.