## 2.6. Graphs

A graph is a set of ordered pairs. Let us denote the class of graphs as gr:

gr R ⇔ (Set R ∧ ∀xR, Fnc x ∧ Dom x = V2).

For any binder Q and any graph G, the formula QzG, A(z0,z1) that binds the variable z = (z0, z1) on a binary structure A definite on G, can be seen as binding 2 variables z0, z1 on A(z0, z1), and thus be denoted with a pair of variables: Q(x,y)∈G, A(x,y).

The transpose of an ordered pair is

t(x,y) = (y,x)

The transpose of a graph R is the image of transposition over it:

tR = {(y,x)|(x,y) ∈ R}

We define the domain and the image of a graph as the respective images of π0 and π1 over it:

Dom R = {x|(x,y) ∈ R}
Im R = {y|(x,y) ∈ R} = Dom tR

### Currying notation

Graphs R can be expressed in curried forms as functors R and R:

xR(x) = {y | (z,y)∈Rz=x}.
yR(y) = {x | (x,z)∈Rz=y} = tR (y).
x,y,   yR (x) ⇔ (x,y) ∈ R ⇔ xR (y)
xx ∈ Dom RR (x) ≠ ∅
Dom RE ⇒ Im R = ⋃xE R(x) ∧ ∀y, R(y) = {xE | (x,y) ∈ R}

They can also appear as functions

RE = (ExR(x))
RF = (FyR(y))
(R) = RDom R
(R) = RIm R.

### Functional graphs

The graph of a function f is defined by

Gr f = {(x,f(x)) | x ∈ Dom f}
x,y, (x,y) ∈ Gr f ⇔ (x ∈ Dom fy = f(x))
Dom f = Dom Gr f
Im f = Im Gr f

For any function f and any graph R,

 Gr f ⊂ R ⇔ ∀x∈Dom f, f(x) ∈ R⃗(x) R ⊂ Gr f ⇔ (Dom R ⊂ Dom f ∧ ∀(x,y)∈R, y = f(x)) R = Gr f ⇔ (Dom R ⊂ Dom f ∧ ∀x∈Dom f, R⃗(x) = {f(x)} )

A graph R is functional if it is the graph of a function. This condition is equivalently written in either way

x∈ Dom R, !: R(x)
x,yR, x0 = y0x1 = y1.

It is then the graph of the unique function ℩R = ((Dom R) ∋ x ↦ ℩(R(x))).

For any set E we shall denote 𝛿E = Gr IdE.

### Indexed partitions

Two sets E and F are called disjoint when EF = ∅, or equivalently ∀xE, xF.
A family of sets (Ai)iI is called pairwise disjoint when ∀ijI, AiAj = ∅
For any graph R with Im RF, the family (R(y))yF is pairwise disjoint if and only if R is functional:

(∀yzF, ¬∃xR(y), xR(z)) ⇔ (∀(x,y)∈R, ∀zF, xRzy = z)

For any function f and any y we define the fiber of y under f as

f(y) = {x∈Dom f | f(x) = y} = (Gr f)(y)

When f : EF this defines a family fF = (f(y))yF of pairwise disjoint subsets of E:

y,zF, f(y) ∩ f(z) ≠ ∅ ⇒ ∃xf(y) ∩ f(z), y = f(x) = z
yF f(y) = E
Im f = {yF | f(y) ≠ ∅}.

An indexed partition of a set E is a family of nonempty, pairwise disjoint subsets of E, whose union is E.
In other words it is any family of the form f = f•Im f for any function f with domain E.

### Sum or disjoint union

The binder ∐ of sum of any family of sets (Ei)iI, gives a graph ∐iI Ei defined as

iI
Ei =
iI
{(i,x) | xEi}
i,x, (i,x) ∈
iI
Ei ⇔ (iIxEi)
(∀(i,x)∈
iI
Ei, A(i,x)) ⇔ (∀iI, ∀xEi, A(i,x))
(∀iI, EiEi) ⇔ ∐iI Ei ⊂ ∐iI Ei
E0⊔…⊔En−1 = ∐iVn Ei
This binder serves as inverse of currying : R = ∐iI Ei ⇔ (Dom RI ∧ ∀iI, R(i) = Ei).
It is also called disjoint union as the family of copies {(i,x) | xEi} of each Ei is pairwise disjoint, with the function from R to I given by π0.

### Direct and inverse images by a graph

The restriction of a graph R to a set A is defined as

R|A = {(x,y)∈R | xA} = ∐xA R(x)

The direct image of a set A by a graph R is
R(A) = Im R|A = ⋃xA R(x) = {y |(x,y)∈RxA} ⊂ Im R.
Dom RA ⇔ R|A = RR(A) = Im R
R(
iI
Ai) =
iI
R(Ai)
R(
iI
Ai) ⊂
iI
R(Ai)

ABR(A) ⊂ R(B)
Similarly, the inverse image or preimage of a set B by a graph R is

R(B) = tR(B) = ⋃yB R(y) = {x | (x,y)∈RyB} ⊂ Dom R.

### Direct image and preimage by a function

The direct image of a subset A ⊂ Dom f by a function f, denoted f[A] or f(A), is
f[A] = (Gr f)(A) = {f(x) | xA} ⊂ Im f
For any f : E → F and BF, the preimage of B by f, written f(B), is defined by

f(B) = (Gr f)(B) = {xE | f(x) ∈ B} =
yB
f(y)
f(y) = f({y})

f(∁F B) = ∁Ef(B)

For any family (Bi)iI of subsets of F, f(⋂iI Bi) = ⋂iI f(Bi) where intersections are respectively interpreted as subsets of F and E.

 Set theory and Foundations of Mathematics 1. First foundations of mathematics 2. Set theory 2.1. Formalization of set theory 2.2. Set generation principle 2.3. Tuples 2.4. Uniqueness quantifiers 2.5. Families, Boolean operators on sets⇦ 2.6. Graphs ⇨ 2.7. Products and powerset 2.8. Injections, bijections 2.9. Properties of binary relations 2.10. Axiom of choice 2.A. Time in set theory 2.B. Interpretation of classes 2.C. Concepts of truth in mathematics 3. Algebra - 4. Arithmetic - 5. Second-order foundations
Other languages:
FR : 2.6. Graphes