3. Specialized figures

For a few kinds of mathematics Definograph has figures of its own: regions for combinations of sets, a coloring rule for graphs, a ball for a metric condition, and regions for maps that are inverse only on part of their domain. Each figure is drawn from a relation Definograph recognizes, and each one says in its caption what it does not claim. This lesson reads one figure of each kind.

Definograph draws these figures only for the Mathlib definitions it recognizes, such as SimpleGraph.Coloring, Metric.ball and PartialEquiv. The same idea written with other definitions stays visible as ordinary typed and logical structure, as in Lesson 2.

Regions for combinations of sets

This is Definograph's example A condition on compound sets:

∀ (α : Type) (A B C : Set α) (x : α),
  x ∈ (A ∪ B) ∩ Cᶜ → x ∈ (A \ C) ∪ (B \ C)

α is any type. ∪ is union, ∩ intersection, Cᶜ the complement of C and A \ C the set difference.

Step 6 of its Visual sequence reads the assumption:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (α : Type) (A B C : Set α) (x : α),
  x ∈ (A ∪ B) ∩ Cᶜ → x ∈ (A \ C) ∪ (B \ C)
In scope∀ α : Type∀ A : Set α∀ B : Set α∀ C : Set α∀ x : α
  1. Given assumption
Condition

Read the membership condition

The condition places x in ((A ∪ B) ∩ Cᶜ) within this logical context.

x belongs to ((A ∪ B) ∩ Cᶜ)
x∈((A ∪ B) ∩ Cᶜ)
Type α
upper leftA
upper rightB
lowerC

The named element must belong somewhere in the highlighted region; no particular membership combination is chosen.

How this set is constructed 3 steps
  1. A∪B(A ∪ B)
  2. CᶜCᶜ
  3. (A ∪ B)∩Cᶜ((A ∪ B) ∩ Cᶜ)
Regions encode membership combinations, not elements or sizes. Drawing a region does not assert that it contains an element.
Lean fragment and source contextx ∈ (A ∪ B) ∩ Cᶜ

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 6 of 10, “Read the membership condition”: the assumption x ∈ (A ∪ B) ∩ Cᶜ as the membership regions it allows inside the type α.
  • The box stands for the type α and the three circles for A, B and C. The key names the circles by position: A upper left, B upper right, C lower.
  • The shaded part is where the assumption allows x to be: in A or in B, and outside C. "The named element must belong somewhere in the highlighted region; no particular membership combination is chosen."
  • The collapsed section How this set is constructed holds the steps that build the set. In Definograph it opens to show them: A ∪ B, then Cᶜ, then their intersection.
  • The caption gives the limits: "Regions encode membership combinations, not elements or sizes. Drawing a region does not assert that it contains an element."

Step 10 reads the conclusion:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (α : Type) (A B C : Set α) (x : α),
  x ∈ (A ∪ B) ∩ Cᶜ → x ∈ (A \ C) ∪ (B \ C)
In scope∀ α : Type∀ A : Set α∀ B : Set α∀ C : Set α∀ x : α
  1. Conditional conclusion
Given
  • x ∈ (A ∪ B) ∩ Cᶜ
Condition

Read the membership condition

The condition places x in ((A ∖ C) ∪ (B ∖ C)) within this logical context.

x belongs to ((A ∖ C) ∪ (B ∖ C))
x∈((A ∖ C) ∪ (B ∖ C))
Type α
upper leftA
upper rightC
lowerB

The named element must belong somewhere in the highlighted region; no particular membership combination is chosen.

How this set is constructed 3 steps
  1. A∖C(A ∖ C)
  2. B∖C(B ∖ C)
  3. (A ∖ C)∪(B ∖ C)((A ∖ C) ∪ (B ∖ C))
Regions encode membership combinations, not elements or sizes. Drawing a region does not assert that it contains an element.
Lean fragment and source contextx ∈ A \ C ∪ B \ C

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 10 of 10: the conclusion x ∈ (A \ C) ∪ (B \ C) as membership regions. The key of the circles follows the operands of this set.

Here the key reads A upper left, C upper right, B lower. Positions can change from one figure to the next, so compare the figures by their labels.

A coloring rule for graphs

This is Definograph's example What a proper coloring requires:

∀ (V C : Type) (G : SimpleGraph V)
  (c : G.Coloring C) (u v : V),
  G.Adj u v → c u ≠ c v

SimpleGraph V is a simple graph whose vertices have type V. G.Adj u v says that u and v are adjacent in G. c : G.Coloring C is a proper coloring of G with colors from C: it gives each vertex a color, and adjacent vertices different colors. ≠ means "is not equal to". The statement says that a proper coloring gives the two ends of any edge different colors.

Step 3 reads the assumption that u and v are adjacent:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (V C : Type) (G : SimpleGraph V)
  (c : G.Coloring C) (u v : V),
  G.Adj u v → c u ≠ c v
In scope∀ V : Type∀ C : Type∀ G : SimpleGraph V∀ c : G.Coloring C∀ u : V∀ v : V
  1. Given assumption
Condition

Read the edge condition

Read adjacency between u and v in G within this logical context.

u is adjacent to v in G
Adjacency conditionSymbolic graph structure
GraphG
adjacency required by this conditionu : Vuv : Vv

The condition requires these named vertices to be adjacent in this graph. Read it within its enclosing assumptions, alternatives, or negation.

Positions encode endpoint roles, not distinctness or geometry. This condition does not specify the full graph.
Lean fragment and source contextG.Adj u v

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 3 of 6 of Definograph’s Visual sequence, “Read the edge condition”: the assumption that u and v are adjacent in G, in its logical place.

The figure marks u and v as the two ends of an edge of G. Its caption: "Positions encode endpoint roles, not distinctness or geometry. This condition does not specify the full graph." The figure is not a picture of G. It shows one required edge, and nothing about the rest.

Step 4 follows the coloring. Its label, Construction, marks a step that builds an object. Here the object is c(u), and the line Constructing part of names the condition that c(u) belongs to, c(u) ≠ c(v). The step also says: "No concrete coloring is chosen."

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (V C : Type) (G : SimpleGraph V)
  (c : G.Coloring C) (u v : V),
  G.Adj u v → c u ≠ c v
In scope∀ V : Type∀ C : Type∀ G : SimpleGraph V∀ c : G.Coloring C∀ u : V∀ v : V
  1. Conditional conclusion
Given
  • G.Adj u v
Construction

Follow the coloring

Read the color assignment and the different-color constraint on every edge. No concrete coloring is chosen.

Constructing part of c(u) is not equal to c(v)

Apply the proper coloringSymbolic graph structure
GraphGusing coloringc
Inputuapplycc(u)source application
if these endpoints are adjacentv₁v₂c : G.Coloring Capply cc(v₁)c(v₂)≠different labels, for every edge

This typed coloring assigns a label to each vertex. For every adjacent pair, its two assigned labels must differ.

Color type or boundC

This type or bound is retained symbolically; no finite palette or cardinality is inferred.

Endpoint slots stand for arbitrary inputs to the rule. They do not instantiate vertices, assert that an edge exists, or determine the graph’s size or shape.
Lean fragment and source contextc u ≠ c v

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 4 of 6 of Definograph’s Visual sequence, “Follow the coloring”. Its stage label, Construction, means that the step builds part of the conclusion: here c(u), one side of c(u) ≠ c(v). The figure shows the rule the coloring c carries for every edge; v₁ and v₂ stand for the two endpoints of any edge, not for u and v.
  • The row marked source application is the application written in the statement: the input u goes through c to its color c(u).
  • Below it, the figure states the rule that every proper coloring satisfies: if two endpoints are adjacent, their colors differ, "different labels, for every edge". The rule is about every edge of G, not only an edge between u and v, so its two endpoints get new names, v₁ and v₂.
  • "Color type or bound C … no finite palette or cardinality is inferred": C may have any number of elements.
  • "Endpoint slots stand for arbitrary inputs to the rule. They do not instantiate vertices, assert that an edge exists, or determine the graph’s size or shape."

A ball for a metric condition

This is Definograph's example A point in an ε-ball:

∀ (c : EuclideanSpace ℝ (Fin 2)) (ε : ℝ),
  0 < ε → ∀ P : EuclideanSpace ℝ (Fin 2),
  P ∈ Metric.ball c ε → dist P c < ε

EuclideanSpace ℝ (Fin 2) is the Euclidean plane. Metric.ball c ε is the open ball of radius ε around c, and dist P c is the distance from P to c.

Step 7 reads the assumption that P lies in the ball:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (c : EuclideanSpace ℝ (Fin 2)) (ε : ℝ),
  0 < ε → ∀ P : EuclideanSpace ℝ (Fin 2),
  P ∈ Metric.ball c ε → dist P c < ε
In scope∀ c : EuclideanSpace ℝ (Fin 2)∀ ε : ℝ∀ P : EuclideanSpace ℝ (Fin 2)
  1. Conditional conclusion
  2. Given assumption
Given
  • 0 < ε
Condition

Read the membership condition

The condition places P in Metric.ball(c, ε) within this logical context.

P belongs to Metric.ball(c, ε)
Open ballSymbolic geometry
cεP
dist(P, c) < ε
Uses the local assumption 0 < ε. Schematic positions; no coordinates chosen. Named points may coincide. Boundary excluded.
Lean fragment and source contextP ∈ Metric.ball c ε

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 7 of 9 of the Visual sequence, “Read the membership condition”: membership in the open ball read as the distance condition, drawn schematically.
  • The figure shows the open ball with its center c and radius ε, the point P inside, and the condition it stands for, dist(P, c) < ε.
  • Above the figure, Given lists the assumption 0 < ε, and the caption begins: "Uses the local assumption 0 < ε."
  • The rest of the caption gives the limits: "Schematic positions; no coordinates chosen. Named points may coincide. Boundary excluded."

This statement can also be explored with numbers. In Definograph, choose Explore a sample; for this statement it opens a Geometry tab, Open ball in 2D, which draws the ball for one choice of values. It starts with c = (0, 0), ε = 1 and P = (0, 0):

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (c : EuclideanSpace ℝ (Fin 2)) (ε : ℝ),
  0 < ε → ∀ P : EuclideanSpace ℝ (Fin 2),
  P ∈ Metric.ball c ε → dist P c < ε
01Open ball in 2D
Numerical illustration
Assumption of an implicationUnder 1 local assumption
Euclidean metric · L2Full two-dimensional view
Ball in 2 dimensions, Euclidean metric · L2-2-2-1-11122cr = 1Px1x2
Open ball · boundary excludedRepresentative point
Why this view

The elaborated metric supports an explicit geometric view of this region.

A numerical illustration from Explore a sample: the open ball with ε = 1 around c = (0, 0) and the point P at its center. It is one sample of values, not the statement. In the app you can move the point by clicking or dragging; in this recording nothing moves.

This figure is one sample, not the statement; Definograph labels it "Numerical illustration". It shows a single choice of c, ε and P, and that choice satisfies the statement's assumptions: ε = 1 is positive, and P lies in the ball because it sits at the center. The statement is about every such choice. No single sample, and no number of samples, shows that it holds for all of them, and a sample is not a proof.

In Definograph you can move P by clicking or dragging in the plot, or open Sample choices ↗ to change the values. In this recorded copy nothing moves. The Scenario tab reports whether the condition holds for the current values, computed approximately, and says that this is not a proof. Changing the values changes the sample, never the statement.

Maps that are inverse on regions

This is Definograph's example An inverse valid on a region:

∀ (A B : Type) (e : PartialEquiv A B) (x : A),
  x ∈ e.source → e.symm (e x) = x

PartialEquiv A B comes from Mathlib. It bundles a map from A to B, a map back from B to A, a region e.source of A and a region e.target of B, and laws that say the two maps undo each other on those regions. e x applies the forward map, and e.symm is the map back.

Step 3 locates the source region:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (A B : Type) (e : PartialEquiv A B) (x : A),
  x ∈ e.source → e.symm (e x) = x
In scope∀ A : Type∀ B : Type∀ e : PartialEquiv A B∀ x : A
  1. Given assumption
Construction

Locate the source region

Identify the designated region inside its carrier. Its extent and nonemptiness are not specified.

Constructing part of x belongs to e.source

The source regionAbstract regions and maps
MapebetweenAandB
A : TypeAsource carriere.source : Set Asource regione.sourcee.sourcepossibly emptyB : TypeBtarget carriertarget regione.targete.targetpossibly emptye : PartialEquiv A Beee⁻¹e⁻¹inverse on these regionsAbstract containers; no geometry or coordinates are specified.
For every element in the source region
xee(x)e⁻¹x
Back to the same source element
For every element in the target region
ye⁻¹e⁻¹(y)ey
Back to the same target element

The forward map takes the source region to the target region. The inverse takes the target back to the source, and each undoes the other on its valid region.

The letters in the round trips are schematic bound variables, not chosen points. Region frames indicate containment, not shape, size, dimension, connectedness, or a proper subset. The inverse laws apply on the specified regions; no inverse law is asserted on the whole carriers.
Lean fragment and source contextx ∈ e.source

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 3 of 7 of the Visual sequence, “Locate the source region”: the two carriers, the designated regions e.source and e.target, and the maps between them. The figure draws both round trips because a PartialEquiv contains a law for each; the statement asserts only the one that starts in the source region.
  • The frames are the two carriers, the whole types A and B that the maps go between. Inside them are the regions e.source and e.target, each marked "possibly empty".
  • e and e⁻¹ connect the regions, "inverse on these regions".
  • The two round trips state the laws: from the source region, x goes to e(x) and back to x; from the target region, y goes to e⁻¹(y) and back to y.
  • The caption: "The letters in the round trips are schematic bound variables, not chosen points. Region frames indicate containment, not shape, size, dimension, connectedness, or a proper subset. The inverse laws apply on the specified regions; no inverse law is asserted on the whole carriers."

Step 6 follows the map back:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (A B : Type) (e : PartialEquiv A B) (x : A),
  x ∈ e.source → e.symm (e x) = x
In scope∀ A : Type∀ B : Type∀ e : PartialEquiv A B∀ x : A
  1. Conditional conclusion
Given
  • x ∈ e.source
Construction

Follow the inverse map

Follow the stored map to its output. Applying the function does not by itself establish membership in a validity region.

Constructing part of e.symm(e(x)) equals x

Apply the inverse mapAbstract regions and maps
MapebetweenAandB
Source expressione.toFun(x)inverse map e.symm(e(x))

Region membership must come from the surrounding statement.

A : TypeAsource carriersource regione.sourcee.sourcepossibly emptyB : TypeBtarget carriertarget regione.targete.targetpossibly emptye : PartialEquiv A Beee⁻¹e⁻¹inverse on these regionsAbstract containers; no geometry or coordinates are specified.
For every element in the source region
xee(x)e⁻¹x
Back to the same source element
For every element in the target region
ye⁻¹e⁻¹(y)ey
Back to the same target element

This is the application appearing in the statement. Its type alone does not establish membership in the valid region; the round-trip law requires that membership.

The letters in the round trips are schematic bound variables, not chosen points. Region frames indicate containment, not shape, size, dimension, connectedness, or a proper subset. The inverse laws apply on the specified regions; no inverse law is asserted on the whole carriers.
Lean fragment and source context↑e.symm (↑e x) = x

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 6 of 7 of the Visual sequence, “Follow the inverse map”: from x through e and back through e.symm, on the designated source region.

Apply the inverse map takes e(x) through the inverse map to e.symm(e(x)). The figure writes e(x) as e.toFun(x): toFun is the name of the forward map inside e. The figure adds: "Its type alone does not establish membership in the valid region; the round-trip law requires that membership." In this statement that membership comes from the assumption x ∈ e.source, which appears above the figure under Given.

What these figures do not tell you

  • That anything is in a set. No region, graph or ball is asserted to have elements, and no figure says how many.
  • Shapes, sizes or positions. Every caption in this lesson says that its geometry is schematic.
  • That the statement is true. Exercise 3.2 is a statement that Definograph draws as carefully as the others, and it is false.
  • Recognition of every encoding. A statement about sets, graphs, metrics or maps gets these figures only when it uses the definitions Definograph recognizes.

Exercises

Exercise 3.1. Compare the shaded parts of the two set figures by their labels. What do you conclude about the statement? Has Definograph proved it?

Hint

List the shaded combinations in each figure, for example "in A, outside B, outside C".

Answer

Both figures shade the same three combinations: in A only, in B only, and in both A and B, each outside C. So every x that the assumption allows is also allowed by the conclusion, and the statement is true. In fact the two sets are equal.

That argument is yours: a check of membership combinations, like a truth table. Definograph drew the figures. It did not prove the statement, and Lean checked only that the statement is well formed.

Exercise 3.2. This is Definograph's example At most four available colors:

∀ (V : Type) (G : SimpleGraph V),
  G.Colorable 4

G.Colorable 4 says that G has a proper coloring that uses at most 4 colors. Its only condition step:

Recorded Definograph output · Lean 4.28.0 ·

Source

Lean statement, as entered in Definograph

∀ (V : Type) (G : SimpleGraph V),
  G.Colorable 4
In scope∀ V : Type∀ G : SimpleGraph V
Condition

Read the coloring requirement

A coloring of G using at most the stated bound is required; adjacent vertices must receive different colors.

G admits a proper coloring with at most 4 colors
Existence of a proper coloringSymbolic graph structure
GraphG
if these endpoints are adjacentv₁v₂apply colorcolor(v₁)color(v₂)≠different labels, for every edge

This condition asks for a map into the available color labels such that adjacent vertices receive different labels. A coloring is not chosen here.

4 available color labels4
0123

These are available labels, not colors assigned to the displayed endpoint slots. A coloring may use fewer labels.

Endpoint slots stand for arbitrary inputs to the rule. They do not instantiate vertices, assert that an edge exists, or determine the graph’s size or shape. Existence remains the statement’s condition; no witness is selected.
Lean fragment and source contextG.Colorable 4

Schematics describe the conditions in their logical context. Shapes and spacing carry no unstated geometric meaning.

Step 2 of 2, “Read the coloring requirement”: G.Colorable 4 read as the existence of a proper coloring with at most four available labels.

Is the statement true? What do the labels 0, 1, 2 and 3 in the figure stand for?

Hint

Think of five vertices, each adjacent to all of the others.

Answer

It is false. In the complete graph on five vertices, every two vertices are adjacent, so all five need different colors, and four colors are not enough. Definograph's description of this example points out that planarity is not assumed.

The labels are the colors a coloring may use: "These are available labels, not colors assigned to the displayed endpoint slots. A coloring may use fewer labels." The figure states the requirement. It does not supply a coloring: "Existence remains the statement’s condition; no witness is selected."

Exercise 3.3. In the ball figure, P is drawn away from the center c. May P be equal to c? Does the figure tell you how far P is from c?

Answer

P may equal c: the caption says "Named points may coincide", and the numerical sample starts with P exactly at c. The figure tells you only what the statement requires, dist(P, c) < ε. The drawn distance means nothing.

Exercise 3.4. Definograph's example The return trip from the target is:

∀ (A B : Type) (e : PartialEquiv A B) (y : B),
  y ∈ e.target → e (e.symm y) = y

Which round trip in the figure for step 3 does this statement use? Would it still hold without the assumption y ∈ e.target?

Hint

The caption says where the inverse laws apply.

Answer

It uses the second round trip: from the target region, y goes to e⁻¹(y) and back to y.

Without the assumption it would be false. Take A and B to be the natural numbers, both regions to be {0}, and both maps to send every number to 0. The laws hold on the regions, but e(e.symm 1) = 0, not 1. As the caption says, "no inverse law is asserted on the whole carriers."