# Hyperiad 0.1.0 builtins

Every builtin function of the Hyperiad language, with its usage. Names follow the Hypergraphs paclet where
the function comes from it. Positions and parts are counted from 1.

## AdjacencyHypermatrix

AdjacencyHypermatrix(hg) is the adjacency hypermatrix of hg: one array per arity and symmetry type of its
edges (Directed -> Rigid, Cyclic -> Cyclic, Unordered -> Symmetric), indexed by the vertices in VertexList
order, each entry counting the edges on that index tuple up to the symmetry. Labeled = true puts the edge
labels in instead (null for an unlabelled edge); that needs a simple hypergraph.

## AllMaps

AllMaps(h1, h2) lists every map h1 → h2 (small spaces only).

## Animate

Animate(expr, [x, values]) is Manipulate that starts playing: expr drawn for each value of x in turn. Options: Interval = ms (default 900); Title = "...".

## AnimateFlow

AnimateFlow(flow, n) moves a token from every point along the flow for n steps, half-step by half-step.

## AnimateMotion

AnimateMotion(m) plays a motion half-step by half-step: a token goes vertex → edge → vertex. Interval = ms.

## AnimateReduction

AnimateReduction(m) steps through the cancellations x y x → x that reduce a motion.

## AnimateSaturation

AnimateSaturation(fields, rules) plays a saturation round by round, the edges each round adds in amber. Types = [...] draws only those types.

## AreaHomotopicQ

AreaHomotopicQ(p, q) is true when a derivation is found, false when a barrier separates them, and "undecided" otherwise (within the default search bounds).

## ArrayAdd

ArrayAdd(a, b, ...) adds arrays entry by entry; a scalar adds to every entry. Same as a + b.

## ArrayDimensions

ArrayDimensions(a) is the list of index lengths of a.

## ArrayDomain

ArrayDomain(a) is the narrowest value domain containing every entry, read off the entries.

## ArrayEntries

ArrayEntries(a) is the entries of a as nested lists. Normal(a) is the same.

## ArrayGraphics

ArrayGraphics(a) draws the array a in the plane. Options: Nesting = [k1, k2, ...], Indices = false.

## ArrayMultiply

ArrayMultiply([a1, a2, ...], spec) contracts the arrays by an index specification, Einstein style:
"ij,jk->ik" (matrix product), "ii->" (trace), "ijp,qrp,qrk->ijk" (the fish product).
The spec may also be index lists: [[1, 2], [2, 3]] -> [1, 3]. Without "->", the indices
occurring once survive in sorted order.

## ArrayNesting

ArrayNesting(n) is how the indices of an n-array are split into blocks of at most two for drawing.

## ArrayObject

ArrayObject(data) is the array with the given entries; ArrayObject(data, sym) declares the index
symmetry sym: "Rigid" (default), "Cyclic" or "Symmetric", checked against the entries.
A scalar is the array of order zero.

## ArrayObjectQ

ArrayObjectQ(x) is true if x is an array object.

## ArrayOrder

ArrayOrder(a) is the number of indices of a.

## ArraySymmetry

ArraySymmetry(a) is the declared symmetry of a: "Rigid", "Cyclic" or "Symmetric".

## ArrayTimes

ArrayTimes(a, b, ...) multiplies arrays entry by entry; a scalar multiplies every entry. Same as a * b.

## Ball

Ball(h, v, r) is the region of the vertices within r steps of v.

## BallGrowth

BallGrowth(h, v, r) lists the sizes of the balls of radius 0, 1, ..., r about v.

## Barrier

Barrier(h, [[u, v], ...]) is a set of pairs of adjacent positions, drawn as amber bars across them.

## BarrierQ

BarrierQ(b) is true when every area holds an even number of its pairs.

## BracketRules

BracketRules("X", "Y") composes both ways and, for (X;Y)(a → c) and (Y;X)(a → c'), c ≠ c', adds the step c' → c of type [X,Y] as a departure and an arrival.

## Cancel

Cancel(fields) cancels each departure v ⇀ e with an arrival e ⇀ v of the same type, until none is left: it plays the pairs, and ends in the net field.

## CancelledFields

CancelledFields(c) is the state a cancellation ends in.

## CanonicalHypergraph

CanonicalHypergraph(hg) is the representative of hg's isomorphism class: vertices renamed 1, ..., n and
labels replaced by tokens ℓ1, ℓ2, ... Isomorphic hypergraphs have equal canonical forms.
Options: Labeled = false canonicalizes the skeleton; Method = "BruteForce" tries every vertex ordering.

## Chart

Chart(h, v, model, centres, r) is an isomorphism of pointed r-balls from h at v to model at a centre (null if none).

## ClosedQ

ClosedQ(region) is true when the region holds the vertices of each of its edges: a sub-hypergraph.

## Closure

Closure(region) adds the vertices of its edges: the smallest closed region containing it.

## ClosureRules

ClosureRules("X") are X X ⇒ X+ (a step) and X+ X X ⇒ X+ (one step more): saturated, the integrated flow.

## CombinatorialSurfaceQ

CombinatorialSurfaceQ(h) is true when every edge is a triangle and every link a cycle.

## CompareValues

CompareValues(s, "f", a, b) compares a scalar field at a and b by cancelling unary edges in pairs, one at each end, until one side runs out: what is left is the difference, at the higher end. It plays the pairs.

## ComparisonSign

ComparisonSign(c) is ↑ when the second end is higher, ↓ when the first is, ○ when equal.

## ComparisonSize

ComparisonSize(c) is how many unary edges are left after the comparison.

## ComposeMaps

ComposeMaps(f, g) is g after f (first f, then g).

## CompositionAdjacencyProduct

CompositionAdjacencyProduct(rule, {"a": g, ...}) is the hypermatrix side of HypergraphCompose: the plex product,
by CompositionPlexDiagram(rule), of the factors' adjacency arrays, summed over the orbit of each index under the
output edge's symmetry; Multiplicity = "Boolean" gives its support, DistinctVertices = true the sum over distinct
indices. It equals the adjacency array of HypergraphCompose(rule, factors) with the same options.

## CompositionPlexDiagram

CompositionPlexDiagram(rule) is the plex diagram of a composition rule with one output edge: its input edges
as plexes named by their factors, the input vertices off the output edge contracted, the output edge's vertices
as the free indices in order.

## CompositionRule

CompositionRule("X", "Y") adds (X;Y)(a → c) for every step of X from a to b followed by a step of Y from b to c (each step a departure and an arrival).

## Concept

Concept(key) shows a definition from the research registry, e.g. Concept("hypermatrix.array_multiply").

## Concepts

Concepts(direction) lists the registry keys of a research direction, e.g. Concepts("hypermatrix").

## ConnectedQ

ConnectedQ(region) is true when the region is connected in the subspace topology; ConnectedQ(h) for a space.

## CriticalPoints

CriticalPoints(f) is {v: kind} for the points of f that are not regular.

## Crossing

Crossing(f, n) is f⁻¹({n, n+1}): the edges sent to the infinitesimal position between n and n + 1 (open).

## Crossings

Crossings(b, p) counts the steps of p across the barrier b.

## CurveOfMotion

CurveOfMotion(m) is the map Interval(n) → h of a motion with n steps between vertices.

## CycleSpace

CycleSpace(n) is the cycle on 0, ..., n − 1.

## Degree

Degree(h, v) is the number of edges containing v: the number of tangent vectors at v.

## Departure

Departure(v, edge) is the tangent vector v ⇀ edge at v: the infinitesimal motion from v into the edge.

## DerivationSteps

DerivationSteps(d) lists the rewrites of a derivation, each with its result.

## Derivative

Derivative(f, t) is the derivative of a scalar function along a tangent vector: ↑, ○ or ↓.

## DeterministicQ

DeterministicQ(s, "X") is true when the X arcs are single and at most one leaves each point: a flow can follow.

## Differential

Differential(f, v) lists the tangent vectors at v with their images, t -> f_* t; for a scalar function, t -> ↑, ○ or ↓.

## DirectionField

DirectionField(h, "X", [dx, dy]) on a space drawn with coordinates (a grid) steps every position to the neighbour at +[dx, dy]. Where = (p => ...) keeps the positions whose coordinates p pass the test; Stay = true puts a stationary edge at the others (where there is a unary edge).

## DistanceFunction

DistanceFunction(h, v) is the scalar function w ↦ HopDistance(h, v, w).

## Edge

Edge([v1, v2, ...]) is a directed hyperedge; Edge(vs, sym) has symmetry "Directed", "Unordered" or
"Cyclic"; Edge(vs, sym, label) labels it. Vertices are stored in the canonical order of the symmetry,
so Edge([3, 1, 2], "Cyclic") == Edge([1, 2, 3], "Cyclic"). An input–output edge is given by its two
nonempty blocks and their types: Edge([[a, b], [c, d, e]], ["Unordered", "Cyclic"], label), or
"InputOutput" for both directed; it is drawn as two lobes joined by a waist with an arrow from inputs to
outputs. Edge([[a], [b]], "InputOutput") is the directed edge Edge([a, b]).

## EdgeBlocks

EdgeBlocks(e) lists the vertices of e by block: [inputs, outputs] for an input–output edge, one block otherwise.

## EdgeCount

EdgeCount(hg) is the number of edges of hg, counted with multiplicity.

## EdgeInputs

EdgeInputs(e) lists the input vertices of an input–output (or directed binary) edge.

## EdgeLabel

EdgeLabel(e) is the label of the edge e, or null.

## EdgeList

EdgeList(hg) is the list of edges of hg, in canonical order, repeats included.

## EdgeOrder

EdgeOrder(s, e) is how many half-steps apart the ends of a field edge lie: 1 for a departure or an arrival, 2 for a step, 4 for a composite of two steps.

## EdgeOutputs

EdgeOutputs(e) lists the output vertices of an input–output (or directed binary) edge.

## EdgePoint

EdgePoint(1, 2, 3) is the edge {1, 2, 3} as a point of an incidence space (it can key an association).

## EdgeSymmetry

EdgeSymmetry(e) is "Directed", "Unordered", "Cyclic" or, for an input–output edge, "InputOutput(S:a,T:b)": a inputs of type S and b outputs of type T.

## EdgeVertices

EdgeVertices(e) is the list of vertices of the edge e.

## EmbeddingQ

EmbeddingQ(f) is true when f is injective and v lies in e whenever f(v) lies in f(e).

## EnumeratePlexProducts

EnumeratePlexProducts(n, k) is the list of closed plex products of order n and arity k: plex diagrams with
k directed plexes of order n (arguments x1, ..., xk) and n free indices (named 1..n in output order), one per
class. Equivalence = "strict" (one per distinct operation), "isomorphism" (up to a common permutation of index
positions, which gives isomorphic algebras), "parastrophy" (also permuting arguments) or "hypergraph" (up to
isomorphism of the diagrams). Connected = false and Diagonals = true widen the enumeration.

## EvenQ

EvenQ(n) is true for an even whole number.

## ExampleSpace

ExampleSpace() is the running example: edges {1,2,3}, {1,2}, {3,4}, {4,5,6}, {2,6}.

## ExitField

ExitField(h, [[1, 2] -> 2, ...]) leaves each edge by one vertex, whatever vertex entered it.

## Expand

Expand(x) multiplies out products and powers.

## Factor

Factor(x) factors a polynomial.

## FieldEdges

FieldEdges(s, "X") lists the edges of type X.

## FieldHypergraph

FieldHypergraph(s) is space and fields as one hypergraph: field edges directed and labelled by type.

## FieldTypes

FieldTypes(s) lists the types of the edges present, in order of appearance.

## FieldValues

FieldValues(s, "f") lists [v, n]: the multiplicity of the unary edges of type f at each v.

## Final

Final(saturation) is the state a saturation ends in.

## FindBarrier

FindBarrier(p, q) searches for a barrier (at most MaxSize pairs, default 4) that p and q cross with different parity: a proof that they are not area-homotopic. Drawn with both paths.

## FindHypergraphIsomorphism

FindHypergraphIsomorphism(g, h) is a vertex map {v: w, ...} carrying g onto h, or {} if there is none.
Labels = true returns {"Vertices": ..., "VertexLabels": ..., "EdgeLabels": ...}, with the label
correspondences. Options Labeled and Method as for IsomorphicHypergraphQ.

## FiniteField

FiniteField(p) is the field with p elements (p prime); FiniteField(p)(k) is the element k.

## FirstBetti

FirstBetti(h) is the number of independent loops of X(h): incidences − vertices − edges + components.

## Flatten

Flatten(list) removes all nesting; Flatten(list, 1) one level.

## Flow

Flow(field, transit) is the flow: one step v → X(v) → leave X(v) as the transit says.

## FlowMap

FlowMap(flow) is {v: φ(v)}: where one step of the flow takes each point.

## Fold

Fold(f, x, list) is f(...f(f(x, l1), l2)..., ln): Fold((a, b) => a + b, 0, [1, 2, 3]) is 6.

## FormalV

FormalV(k) is the k-th vertex name a rewrite gives to the vertices it creates, shown vₖ.

## Frontier

Frontier(region) is its closure minus its interior.

## FundamentalGroup

FundamentalGroup(h, v) presents π1(h, v), loops at v up to area homotopy: one generator per step outside a spanning tree, one relator per triangle inside an area, then simplified (Simplify = false keeps it raw). Drawn with the generator loops.

## GenerateSymbolicArray

GenerateSymbolicArray(a, dims) has entries a[i, j, ...]; GenerateSymbolicArray(a, dims, sym) respects the symmetry sym.

## Geodesic

Geodesic(h, x, y) is a motion from x to y with fewest half-steps (null if there is none).

## GradientFlow

GradientFlow(f) climbs a scalar function f: depart upward, leave at the highest vertex. Ascending = false descends.

## GridSpace

GridSpace(m, n) is an m × n piece of the square grid, vertices numbered 1..mn row by row.

## GrowthDimension

GrowthDimension(h, v, r) is a device (real-valued): the slope of log |B_r| against log r at scale r.

## HalfSteps

HalfSteps(m) is the number of half-steps of a motion (twice its steps, between vertices).

## Help

Help(name) describes a builtin: Help("ArrayMultiply") or Help(ArrayMultiply).

## HomotopicQ

HomotopicQ(m1, m2) is true when the step paths of the motions are area-homotopic (a derivation is found), false when their ends differ or a barrier separates them, and "undecided" otherwise.

## HomotopyDerivation

HomotopyDerivation(p, q) searches for a shortest chain of rewrites (all rules, both ways) turning p into q, among paths of at most MaxLength steps (default: the longer path plus 2); it plays step by step.

## HomotopyRules

HomotopyRules() draws the rules of area homotopy: contract, expand, cancel, stall.

## HopDistance

HopDistance(h, v, w) is the least number of edges a motion from v to w crosses (null if none).

## Hypergraph

Hypergraph(edges) builds a hypergraph from edges: Edge objects or lists of vertices (directed).
Hypergraph(vertices, edges) adds vertices, possibly isolated or labelled; Hypergraph(vertices) is
edgeless. A hypergraph is a multiset of edges: order does not matter, multiplicity does.

## HypergraphCausalGraph

HypergraphCausalGraph(sys, n) is the causal graph of sys evolved n generations: one vertex per event, an
edge from an event to a later one on the same path that touches some of the same elements.
HypergraphCausalGraph(rules, init, n) builds the system first. Options as for HypergraphRewritingSystem.

## HypergraphCompose

HypergraphCompose(rule, {"a": g, "b": h, ...}) is the composition of hypergraphs by a rule, on their common
vertex set: each input edge of the rule names the factor it comes from ("a", or a(x) to match that edge's own
label as x), and every match over the factors gives one copy of the rule's output edges. Graph composition is
HypergraphCompose(HypergraphRule([Edge([1, 2], "Directed", "a"), Edge([2, 3], "Directed", "b")], [[1, 3]]),
{"a": g, "b": h}). Multiplicity = "Count" (a multiset: one edge per match), "Boolean" (each edge once) or
"Labels" (the labels the output writes, one edge per match: formal sums of labels). Matching is non-injective
on vertices and edges unless DistinctVertices / DistinctEdges = true; Vertices = [...] fixes the vertex set.
The adjacency hypermatrix of the result is the plex product CompositionAdjacencyProduct gives.

## HypergraphEmbedding

HypergraphEmbedding(hg) is the list of vertex positions [x, y] HypergraphPlot uses, in vertex order. VertexCoordinates = ... fixes some, as for HypergraphPlot.

## HypergraphEventPlot

HypergraphEventPlot(event) draws an event: what it acted on with the match highlighted, an arrow, and the
result with the created vertices and edges highlighted. HypergraphEventPlot(rule, hg) draws every event.
Options: VertexLabels = true; SharedCoordinates = false.

## HypergraphPlot

HypergraphPlot(hg) draws hg. Options: VertexLabels = true writes vertex identifiers;
Highlight = [i, ...] draws the i-th edges of EdgeList(hg) highlighted (or edges given by value);
HighlightVertices = [v, ...] highlights those vertices; VertexCoordinates = {v: [x, y], ...}
fixes positions (the rest settle among them); Title = "...".

## HypergraphQ

HypergraphQ(x) is true if x is a hypergraph.

## HypergraphRewritingSystem

HypergraphRewritingSystem(rules, init) is the rewriting system of the rules (a rule, lhs -> rhs, or a list)
started from the hypergraph init. sys("Prop", n) or sys["Prop", n] is a property of its evolution carried n
generations: "StateCount", "EventCount", "StateList", "States", "EventList", "CausalEdges", "CausalGraph",
"EvolutionGraph", "StatesGraph", "BranchialGraph", "EvolutionCausalGraph", "TokenEventGraph"; sys["Rules"],
["InitialState"], ["Options"]. Options held by the system or given to a property: CausalDependence =
"Elements" | "Edges" | "Vertices", TransitiveReduction, CanonicalizeStates, MaxStates, Labeled, LabelPatterns,
DistinctVertices, DistinctEdges, StateRendering, EventRendering, MaxDrawnVertices, PanelSize.

## HypergraphRewritingSystemQ

HypergraphRewritingSystemQ(x) is true if x is a rewriting system.

## HypergraphRule

HypergraphRule(input, output) is the rewrite rule taking hypergraph input to output; either side may be
anything Hypergraph accepts. rule(hg) applies it. In the input, a label that is a bare name (x) is a variable
binding whatever it meets, no label matches anything, anything else ("f", 1) only itself; Verbatim(x) matches
x literally. A composite label holding names is a structured pattern: comp(x, id(X)) matches comp(f, id(A)),
binding x and X (syntactically: no equations between labels are assumed). Vertex and edge labels share their
bindings. The output's labels are written with the bindings put in, e.g. Row(["(", x, y, ")"]).
Properties: rule["Input"], ["Output"], ["SharedVertices"], ["NewVertices"], ["DeletedVertices"], ["Signature"].

## HypergraphRuleApply

HypergraphRuleApply(rule, hg) (or rule(hg)) is the list of events, one per way the rule's input matches hg.
An event draws as the match highlighted beside the result with its creations highlighted; ev["Hypergraph"] is the
result, and ev["MatchEdgePositions"], ["MatchVertices"], ["NewVertices"], ["NewEdges"], ["DeletedVertices"],
["EdgeOrigins"], ["RuleVertexMap"], ["LabelBindings"], ["Input"], ["Rule"] say what happened.
Options: Labeled = false ignores labels; LabelPatterns = false reads names in labels literally;
DistinctVertices = false lets two vertices of the rule land on one (an isolated one too); DistinctEdges = false
lets one edge of hg fill several edges of the rule's input.

## HypergraphRuleMatches

HypergraphRuleMatches(rule, hg) is the list of ways the rule's input sits in hg, without rewriting:
{"MatchEdgePositions": ..., "RuleVertexMap": ..., "LabelBindings": ...} each. Options as HypergraphRuleApply.

## HypergraphRuleOnePass

HypergraphRuleOnePass(rule, hg) applies every match of the rule to hg at once: the result has hg's vertices
(and any the matches create, named apart) and, for each match, the edges the rule's output creates there. Options
as HypergraphRuleApply (Labeled, LabelPatterns, DistinctVertices, DistinctEdges).

## HypergraphRulePlot

HypergraphRulePlot(rule) draws the rule: input, arrow, output, on a shared layout, with the vertices it
destroys and creates highlighted. Options: VertexLabels = true; Highlight = false; SharedCoordinates = false.

## HypergraphRuleQ

HypergraphRuleQ(x) is true if x is a rewrite rule.

## HypergraphSaturate

HypergraphSaturate(hg, rules) saturates hg: in each round every match of every generating rule adds what the
rule's output creates (keeping what it matched), then the equation rules (Equations = [...]) rewrite, as ordinary
rules, until none applies; edges form a set. It stops when a round changes nothing, or after MaxRounds = 20.
Labels are syntax: equalities between them (units, associativity, a commuting square) are equation rules.
IdentifyByLabel = true merges vertices with equal labels after each round (one vertex per object). Generating
rules match non-injectively (DistinctVertices, DistinctEdges = false); equations consume distinct edges.
Congruence = true also applies each equation that rewrites one edge's label on the same vertices (with no
condition on vertex labels) inside labels, at every subterm: equal morphisms then have equal composites.
A structure whose closure is infinite (a cycle, a heap) does not saturate: MaxRounds and MaxEdges = 1000 stop it.
Shown as one frame per round, what it added in amber; s["Final"], ["States"], ["Added"], ["Saturated"],
["Rounds"], ["StoppedBy"].

## HypergraphSkeleton

HypergraphSkeleton(hg) drops every vertex and edge label, keeping symmetry types.

## Hypermatrix

Hypermatrix([a1, a2, ...]) (or Hypermatrix(a1, a2, ...)) holds the arrays in canonical order: by order, then
dimensions, then symmetry (Symmetric, Cyclic, Rigid). Raw entries become arrays. Properties: hm["Arrays"],
["Length"], ["Orders"], ["Dimensions"], ["Symmetries"], ["Domains"], ["Entries"]; hm[k] is the k-th array.

## HypermatrixArrays

HypermatrixArrays(hm) is the list of arrays of hm, in canonical order.

## HypermatrixQ

HypermatrixQ(x) is true if x is a hypermatrix.

## IdentityArray

IdentityArray(n, d) is 1 where all n indices (of length d) agree, 0 elsewhere. IdentityArray(n, d, domain).

## IdentityMap

IdentityMap(h) is the identity map of h.

## If

If(cond, a, b) is a when cond is true and b when it is false (b defaults to null).

## ImmersionQ

ImmersionQ(f) is true when f_* is injective at every point.

## IncidenceGroupGenerators

IncidenceGroupGenerators(h, v) lists reduced closed motions at v that freely generate π1 of the incidence space.

## IncidenceHomotopicQ

IncidenceHomotopicQ(m1, m2) is true when the motions have the same ends and the same reduced form under x y x → x: homotopy in the incidence space, where hyperedges are not filled.

## IncidenceSpace

IncidenceSpace(h) is X(h): vertices and edges as the points of one finite space, v below e when v is in e, the open sets the up-sets. Drawn as its diagram: positions below, infinitesimal positions above.

## IncomingDirection

IncomingDirection(m, i) is the tangent vector back into the edge the motion arrived from at its i-th point.

## InducedSubspace

InducedSubspace(h, vertices) keeps the edges of h lying inside the given vertices.

## InfinitesimalPositions

InfinitesimalPositions(h) lists the edges of h: the open points of X(h).

## IntegralCurve

IntegralCurve(flow, v) follows the flow from v until it ends, rests or closes up.

## Interior

Interior(region) drops the vertices whose star leaves it: the largest open region inside.

## Interval

Interval(n) is the path on 0, 1, ..., n: the domain of a curve with n steps.

## IsomorphicHypergraphQ

IsomorphicHypergraphQ(g, h) is true if a renaming of vertices carries g onto h, each edge keeping its
symmetry type. Labels count up to renaming (vertex labels and edge labels independently).
Options: Labeled = false compares skeletons; Method = "BruteForce".

## IsomorphismQ

IsomorphismQ(f) is true when f is a bijection of points keeping incidence both ways.

## Join

Join(l1, l2, ...) is the lists one after another; Join(hg1, hg2, ...) the hypergraphs' union.

## JoinFields

JoinFields(f, g, ...) puts fields on one space together, keeping their types and colours.

## JoinMotions

JoinMotions(m1, m2) is m1 followed by m2 (m2 starts where m1 ends).

## KleinGrid

KleinGrid(m, n) is the m × n grid closed up into a Klein bottle (one seam reflected).

## LabelToken

LabelToken(k) is the k-th label of a canonical form, shown ℓk: canonical forms count labels only up to renaming, so they replace them by tokens.

## Length

Length(x) is the number of elements of a list (or the first dimension of an array).

## LevelSet

LevelSet(f, n) is f⁻¹(n): the vertices at n and the edges sent to {n} (a closed region).

## Link

Link(h, v) is the link of v: on its neighbours, the edges e minus v for the edges e through v.

## LinkDimension

LinkDimension(h, v) is 1 + the largest link dimension inside the link of v (0 for a point on no edge but {v}); LinkDimension(h) is the largest over the points.

## ListAnimate

ListAnimate(list) shows the pictures of a list one after another. Options: Labels = [...], Interval = ms, Play = false for a stepper, Title = "...".

## LocalIsomorphismQ

LocalIsomorphismQ(f) is true when f_* is a bijection at every point.

## LocallyModelledQ

LocallyModelledQ(h, model, centres, r) is true when every pointed r-ball of h is isomorphic to the pointed r-ball of model about one of the centres.

## Manipulate

Manipulate(expr, [x, values]) draws expr for each value of x, with a slider and step buttons to choose x. [x, n] and [x, a, b] count as in Table. Options: Play = true starts it playing; Interval = ms; Title = "...".

## Map

Map(f, list) applies f to each element: Map(x => x^2, [1, 2, 3]).

## MapApply

MapApply(f, x) is the image of a point (vertex or edge) under the map f.

## MapImage

MapImage(f) is the image of f, a region of its target.

## MapPlot

MapPlot(f, v) draws the map f with the tangent vectors at v and their pushforwards in blue.

## MinimalOpen

MinimalOpen(h, x) is U_x, the smallest open set containing the point x: a vertex with its star, or an edge alone.

## Mod

Mod(a, n) is the remainder of a on division by n, between 0 and n - 1.

## Motion

Motion(h, [x0, x1, ...]) is a motion through points of X(h), alternating vertices and edges (edges as lists), each incident to the next: Motion(h, [1, [1, 2], 2]).

## MotionGraph

MotionGraph(h) is the graph of all half-steps: v ⇀ e and e ⇀ v for each vertex v of each edge e.

## MotionOfCurve

MotionOfCurve(c) is the motion of a map from an interval.

## MotionPoints

MotionPoints(m) lists the points a motion passes through.

## N

N(x) is the numerical value of x; N(x, digits) to the given precision.

## Names

Names() lists the builtins; Names("Array*") those matching a pattern.

## Neighbourhood

Neighbourhood(h, v) is N[v]: v and every vertex sharing an edge with it, as a region.

## Normal

Normal(a) is the entries of the array a as nested lists; Normal(hm) those of each array of hm.

## Octahedron

Octahedron() is the octahedron as 8 triangles: a combinatorial sphere.

## OddQ

OddQ(n) is true for an odd whole number.

## OneArray

OneArray(n, d) is the n-array with indices of length d and entries 1. ZeroArray's other forms apply.

## OpenHull

OpenHull(region) adds the star of each vertex: the smallest open region containing it.

## OpenQ

OpenQ(region) is true when the region holds the star of each of its vertices.

## ParallelEdges

ParallelEdges(hg) lists the groups of edges on the same vertices with the same symmetry, as
{"Vertices": [...], "Labels": [...]}: in a saturated diagram, a group with different labels is a pair of paths
that no equation has made equal (the diagram does not commute there).

## PartialIdentityArray

PartialIdentityArray(n, d, positions) is 1 where the indices at the given positions agree.

## PathOfMotion

PathOfMotion(m) is the step path of a motion: its positions, infinitesimal ones forgotten.

## PathPositions

PathPositions(p) lists the positions of a step path.

## PathRewrites

PathRewrites(p) lists every single rewrite of p by the shortening rules (cancel, stall, contract); PathRewrites(p, All = true) adds the expanding ones.

## PathSpace

PathSpace(n) is the path on 0, 1, ..., n.

## PlexContractedVertices

PlexContractedVertices(d) is the marked vertices of d: the indices summed over.

## PlexDiagram

PlexDiagram(edges, contracted) is the plex diagram on these edges (vertex lists or Edge objects): a
labelled hypergraph whose edges are plexes, named p1, p2, ... (or Names = [...]), and whose vertices in
contracted are marked • (summed over); the rest are free. Symmetry = "Unordered" makes plain lists
unordered plexes (taking symmetric arrays). A directed edge's vertex order is its array's index order.

## PlexEqualQ

PlexEqualQ(t1, t2, ops) is true when the terms t1 and t2 are the same operation on arrays: their diagrams are
isomorphic by a map that fixes every variable and the output order (over every commutative semiring and in every
dimension; for terms using each variable once this decides equality over the integers).

## PlexEvents

PlexEvents(rule, d) is the events of a plex rule on the plex diagram d that contract all the rule's marked vertices (no plex outside the match uses them): exactly those keep the value of d.

## PlexFreeVertices

PlexFreeVertices(d) is the free (unmarked) vertices of d: the indices of its product.

## PlexIdentities

PlexIdentities(terms, ops) groups the terms into classes of equal operations (PlexEqualQ) and gives the
classes with more than one term: each an identity, shown as the diagram its terms share, captioned with the
equation. id["Terms"] and id["Diagram"] take it apart. All = true also gives the classes of one term.

## PlexNames

PlexNames(d) is the list of plex names of the diagram d, the order PlexProduct takes arrays in.

## PlexNormalForms

PlexNormalForms(d, rules) is the diagrams reached by rewriting the plex diagram d with the plex rules (from
PlexRule) at valid events, in every possible order, until no rule applies. Each rule must shrink the diagram.
Every normal form has the value of d: when they are single plexes their labels are equal terms, and
PlexNormalTerms gives those terms.

## PlexNormalTerms

PlexNormalTerms(d, rules) is the terms of the normal forms of d that are single plexes (PlexNormalForms): all
equal to d's product, so together an identity, associativity read as confluence. Plex names that are names
("a") appear as variables (a).

## PlexProduct

PlexProduct(d, arrays) evaluates the plex diagram d: arrays is a list (in PlexNames order) or {name: array};
the result's indices are the free vertices in vertex order (or Output = [...]), summed over the marked ones.
A label that is a term P(x, y, ...) of a diagram in Diagrams = {"P": d2} is evaluated as that product first.

## PlexRule

PlexRule(d, "P") is the plex diagram d as a rewrite rule: its plexes, with variable labels, become one plex on
its free vertices labelled P(x, y, ...). PlexEvents(rule, d2) applies it where it really contracts.

## PlexTermDiagram

PlexTermDiagram(t, ops) is the plex diagram of the term t in the operations ops = {"M": d1, ...} (plex
diagrams): each operation replaced by its diagram, an argument's output glued to the plex it fills, contracted
indices renamed apart. The free vertices, in vertex order, are the term's output. A bare variable needs
Order = n.

## PlexTerms

PlexTerms(ops, vars) is every term in the operations ops = {"M": d1, ...} in which each of the variables vars
occurs exactly once, with at most MaxOperations = 2 operations; all variables are arrays of order Order = 2, and so
is each term. These are the terms PlexIdentities searches among.

## PointKind

PointKind(f, v) is "regular", "maximum", "minimum" or "flat" for a scalar function f.

## PointedBall

PointedBall(h, v, r) is the ball of radius r about v with the edges inside it, centre v: a region.

## Points

Points(h) lists the points of the incidence space X(h): vertices, then edges.

## Positions

Positions(h) lists the vertices of h: the positions, closed points of X(h).

## Print

Print(x, ...) shows each value in the cell's output.

## PushMotion

PushMotion(f, m) is the motion f(m) in the target.

## Pushforward

Pushforward(f, t) is f_* t: the tangent vector f(v) ⇀ f(e) for t = v ⇀ e, or the point f(v) when e collapses.

## RandomInteger

RandomInteger([lo, hi]) is a random integer; RandomInteger([lo, hi], dims) a nested list of them.

## Range

Range(n) is [1, ..., n]; Range(a, b) is [a, ..., b]; Range(a, b, step).

## ReduceMotion

ReduceMotion(m) is the normal form of m under the rewrite x y x → x (cancel a step straight back).

## ReducePath

ReducePath(p) shortens p by cancel, stall and contract, leftmost first, until none applies.

## ReductionSteps

ReductionSteps(m) lists m and each motion after cancelling the leftmost backtrack x y x → x.

## Region

Region(h, points) is a set of points of X(h): vertices and edges (edges as lists of vertices).

## RegularArrayQ

RegularArrayQ(a) is true if every index of a has the same length.

## ReverseMotion

ReverseMotion(m) runs a motion backwards.

## RewritingSystemProperty

RewritingSystemProperty(sys, "Prop", n) is sys("Prop", n): a property of the evolution carried n generations.

## Rounds

Rounds(saturation) lists how many edges each round added.

## Saturate

Saturate(fields, rules) applies the rules everywhere, round after round, until nothing new appears; it shows the result (Final(s) is the state).

## ScalarField

ScalarField(h, "f", {v: n, ...}) lays n unary edges of type f at each v: a scalar field, its values inferred from the multiplicities (0 where there are none).

## ScalarFieldOf

ScalarFieldOf(f, "f") is the scalar field of a scalar function (map version): f(v) - min f unary edges at v.

## ScalarFunction

ScalarFunction(h, values) is the map h → the scalar line with values {v: n, ...} at the vertices; values on
one edge lie within one step. EdgeValues = [[1, 2] -> [5, 6], ...] sets an edge's value where the values of its
vertices leave a choice (an edge on which f is n may go to [n], [n - 1, n] or [n, n + 1]).

## ScalarLine

ScalarLine(a, b) is the window a..b of the scalar line: the path with an edge {n} at each point.

## ScalarPlot

ScalarPlot(f, v) draws f with the derivative at v in blue; ScalarPlot(f, region) marks a region.

## SeedRandom

SeedRandom(n) makes the random numbers that follow reproducible.

## Select

Select(list, test) keeps the elements for which test gives true.

## ShowFields

ShowFields(s, ["X", ...]) draws only the edges of the given types (in their usual colours).

## SimpleHypergraphQ

SimpleHypergraphQ(hg) is true if no edge of hg is repeated (labels set aside). A vertex repeated within one edge is allowed.

## Simplify

Simplify(x) simplifies a symbolic expression (entry by entry on arrays and lists).

## SpatialHypergraph

SpatialHypergraph(edges) is the space with these edges, each a list of vertices; an edge may have one
vertex. SpatialHypergraph(edges, vertices) adds isolated points. A hypergraph converts too (symmetry
types and labels are forgotten). Edges are undirected and none repeats.

## SpatialMap

SpatialMap(h1, h2, vertexmap, edgemap) is the map sending vertices and edges together, keeping incidence:
vertexmap is {v: w, ...}; edgemap is [[1, 2] -> [5, 6], ...] (or keyed by EdgePoint), and [[1, 2] -> 5]
collapses the edge onto the vertex 5 (all its vertices must go there). An edge left out goes to the edge
spanned by its image when that is an edge of h2, else to the one edge of h2 containing its image.

## Sphere

Sphere(h, v, r) is the region of the vertices exactly r steps from v.

## Star

Star(h, v) lists the edges containing the vertex v.

## StationaryQ

StationaryQ(t) is true for a tangent vector v ⇀ {v}: the hypergraphic zero.

## StepPath

StepPath(h, [v0, v1, ...]) is the path through these positions, each two consecutive ones in a common edge of h (a chain of binary path edges); drawn as green arcs.

## Sublevel

Sublevel(f, n) is the region where f is at most n.

## SubmersionQ

SubmersionQ(f) is true when f_* is onto the tangent space of the image at every point.

## Subsets

Subsets(list) is every sublist (in order); Subsets(list, k) those of k elements.

## Subspace

Subspace(region) is the region with the subspace topology, as a spatial hypergraph: its vertices, with each of its edges cut down to them.

## Table

Table(expr, [i, n]) is [expr for i = 1..n]; iterators [i, a, b], [i, a, b, step] and [i, list]; several iterators nest, the first outermost.

## TangentBundle

TangentBundle(h) lists every tangent vector of h: one per incidence.

## TangentSpace

TangentSpace(h, v) lists the tangent vectors at v, one departure v ⇀ e per edge e through v; drawn.

## TokenRewritingSystem

TokenRewritingSystem(h, x) is the hypergraph rewriting system of a token at the point x of X(h): one departure and one arrival rule per edge size. Ask it sys("StatesGraph", n) as any rewriting system.

## TokenState

TokenState(h, x) is h with a token at the point x, as a hypergraph: the state of TokenRewritingSystem.

## Torus7

Torus7() is the 7-point torus: 14 triangles, every two points adjacent.

## TorusGrid

TorusGrid(m, n) is the m × n grid closed up into a torus, vertices numbered row by row.

## Total

Total(list) adds the elements of a list; Total(array) adds all entries of an array.

## Trace

Trace(h, vertices) cuts every edge of h down to the given vertices (dropping those it misses).

## Transit

Transit(h, [[1, 2, 3] -> {1: 3, 2: 1}, ...]) says, for each edge, by which vertex to leave given the entry.

## TriangulatedAnnulus

TriangulatedAnnulus(n) is an annulus of 2n triangles round a hole: inner ring a1..an, outer b1..bn.

## TriangulatedDisk

TriangulatedDisk(n) is a disk: a centre 0 and a rim 1..n, the n triangles {0, i, i+1}.

## Tuples

Tuples(list, n) is every list of n elements of list (with repetition); Tuples([l1, l2, ...]) one from each.

## Union

Union(l1, l2, ...) is the distinct elements of the lists, in first-seen order.

## VectorField

VectorField(h, {v: edge, ...}) chooses a tangent vector v ⇀ edge at some points.

## VectorFieldArcs

VectorFieldArcs(h, "X", [[v, [edge]], [[edge], v], ...]) is the vector field with these departures v ⇀ e and arrivals e ⇀ v (an arrival is a negative direction); repeats count.

## VectorFieldEdges

VectorFieldEdges(h, "X", {a: b, ...}) is the vector field of type X stepping a → b: the departure from a into the smallest edge holding both and the arrival from it at b (b = a stays on the unary edge {a}).

## VectorFieldQ

VectorFieldQ(s, "X") is true when the X edges are all departures and arrivals.

## Velocity

Velocity(m, i) is the tangent vector by which the motion leaves its i-th point (a vertex; counted from 1).

## Verbatim

Verbatim(x), as a label in a rule's input, matches the label x literally instead of binding it.

## Vertex

Vertex(id) is a vertex with identifier id; Vertex(id, label) gives it a label. Edges and hypergraphs also accept bare identifiers.

## VertexCount

VertexCount(hg) is the number of vertices of hg.

## VertexID

VertexID(v) is the identifier of the vertex v.

## VertexLabel

VertexLabel(v) is the label of the vertex v, or null.

## VertexList

VertexList(hg) is the list of vertices of hg, in canonical order.

## WithUnaryEdges

WithUnaryEdges(h) adds the edge {v} at every vertex v, so every point can rest.

## ZeroArray

ZeroArray(n, d) is the n-array with indices of length d and entries 0. ZeroArray(dims) gives the dimensions; a last argument names the domain.
