Library / Mathematical Thinking DPF
Jump to passage
In this reading

Link to current text

Published source confirmed at last check

Source changed 2026-10-03 02:22:15 UTC · snapshot created 2026-10-03 03:38:22 UTC · last check 2026-10-03 05:10:10 UTC

Part of a long section. Showing characters 1–59845 of 141431. Continue below for the remaining text.

Part A - Choose and relate constructions

MATH.16 - Choose a Mathematical Construction from Its Required Maps (Universal Property)

Type: Method Status: Usable, evolving Normativity: Normative

MATH.16:1 - Problem frame

Use this pattern when you need a mathematical object but have not decided how to construct it. You can describe what should be recoverable from it, what data should determine it, or which functions it must support. The difficulty is choosing among constructions that can all look plausible while supporting different uses.

For example, a result may need to carry two answers together, carry either kind of answer, or combine answers that agree about a shared quantity. These requests lead to different mathematical objects. Choosing a familiar representation first can hide the difference until a later operation fails.

Start by naming one operation the new object must support and the information that should determine its result. Draw the corresponding functions, including their directions. A useful first result is a requirement that distinguishes two candidate constructions. Continue to a construction and its use when the question needs them.

The method develops a universal property: a specification of an object through the maps it must admit and the equations those maps satisfy. The main route uses sets and all functions between them. The reader needs elementary sets, function composition and equality; the remainder example also explains the modular arithmetic it uses. Paragraphs marked Additional structure are optional and assume knowledge of the named mathematical theory.

If an available object and operation already answer the question, use them. A universal specification becomes useful when choosing, explaining, comparing or changing the construction is part of the work. Establishing the property for every allowed input needs an argument; working a few examples can expose a failure but cannot establish that general claim.

MATH.16:2 - Problem

A familiar notation can suggest an object without explaining why it has the right structure. A pair of entries, a sequence, an equivalence class and a tagged alternative may all hold related information, yet the operations available on them differ.

Even an apparently adequate requirement can leave the object underdetermined. An object from which two entries can be recovered might also contain an extra entry. To say that the first two entries determine the whole, we need a further condition. Without it, a later map may require information that the proposed construction never supplied.

The problem is to turn the intended use into a mathematical specification, construct an object that satisfies it, and derive the maps and comparisons needed next.

MATH.16:3 - Forces

ForceTension
Familiar representation and needed operationsA convenient notation can make calculation easy while omitting a required construction or recovery.
Recoverable data and additional choiceRecovering the inputs leaves open whether they determine the complete result.
General specification and existenceA universal property can identify the desired object even when it has no realization in the chosen setting.
Structural sameness and computational effortTwo constructions can support the same maps while requiring different work to calculate with them.

MATH.16:4 - Solution

Local mantra: start from the use; choose maps and laws; construct the object; derive its uses; revise the changed requirement.

MATH.16:4.1 - Express the needed use as maps and equations

Describe what a user of the mathematical object will put in and obtain. Introduce symbols after those meanings are clear. A function f:X -> A takes an input in X and returns one element of A. Its direction matters: receiving an A and returning an X is another operation.

Ask what information completely determines the proposed result. If later use needs an extra choice, include that choice in the input. If the supplied data should suffice, require the resulting map to be unique.

The following contrasts help select a construction; they are examples of different mapping requirements:

Needed useMaps and question to formulate
Carry two components together and recover each one.Seek maps from the new object to both component objects. What combined map is determined by supplying the two components?
Carry either kind of input, then process it according to that kind.Seek maps from each input object into the new object. Do the two processing rules determine one rule on the combined object?
Combine components that must agree about a common quantity.Express both accounts of that quantity in one codomain and require equality.
Identify inputs while retaining selected answers.Which maps give the same answer on identified inputs, and therefore can operate on classes? MATH.2 supplies that quotient construction.
Interpret everything built from generating operations.Which assignment to generators extends to a map preserving the operations? MATH.5 supplies the extension and its uniqueness.

Choose the mathematical setting along with the maps. In the main route, the objects are sets and the permitted maps are all functions between them. A category specifies a setting through its objects, maps, identity maps and associative composition.

Additional structure – groups and topology. For groups, choose homomorphisms preserving the group operation; for topological spaces, choose continuous functions. These choices change what must be constructed and proved.

MATH.16:4.2 - State the universal property before choosing an encoding

Turn the use into a requirement by comparing the proposed object with arbitrary permitted ways of supplying or processing its data:

  1. Fix the objects already given by the question, together with their maps and laws. They remain the same throughout this comparison.
  2. Introduce a variable object X for a possible source of data, or Z for a possible destination. Describe the maps and equations that make it an allowed instance of the needed use. Let it vary over every permitted instance, not just one sample. For example, a source of two components supplies functions from X to each fixed component set.
  3. Seek an object P with the maps through which it will be used. Ask how an allowed instance should relate to P: should its data assemble into P, or should processing extend from P to a destination? Draw that comparison map in the corresponding direction.
  4. Combine the comparison map with P’s use maps in the order their domains require, and equate the resulting routes with the original maps. Require a comparison map for every allowed instance, and uniqueness when the supplied data should determine it completely.

This specifies the behavior a construction must realize. If the intended use leaves the maps or agreements undecided, return to that particular choice before asking for a universal object. The prepared-function case in :5.4 follows these steps for a use beyond pairing or tagging.

Suppose the question requires two recoverable components in A and B, and those components must determine the entire result. A and B are fixed; a trial source X supplies maps to both. Seek an object P with projections pA:P -> A and pB:P -> B.

For every allowed object X and maps f:X -> A, g:X -> B, require a unique map <f,g>:X -> P such that:

pA composed with <f,g> = f;

pB composed with <f,g> = g.

These equations say that forming the combined result and reading either component returns the supplied component. Uniqueness says there is no further choice in that combination. Any map h:X -> P is consequently recovered from its components:

<pA composed with h, pB composed with h> = h.

An object with these projections and property is a product of A and B. Its specification describes both how to construct a result and how to use it.

Now suppose the components must agree through maps s:A -> C and t:B -> C. Seek projections that satisfy:

s composed with pA = t composed with pB.

Require a unique combined map only for f and g satisfying s composed with f = t composed with g. This is a pullback of s and t: it combines precisely the data compatible under that equation.

To choose an object for either kind of input, reverse the mapping question. Seek maps iA:A -> S and iB:B -> S that place the inputs in the new object. For maps f:A -> Z and g:B -> Z, require a unique map [f,g]:S -> Z with [f,g] composed with iA = f and [f,g] composed with iB = g. This is a coproduct. In sets, a tag can preserve which input was supplied, so the processing rule can select the correct branch.

The comparison points into the product or pullback and out of the coproduct. Its direction follows the needed operation: assemble supplied components or extend supplied processing rules.

MATH.16:4.3 - Construct an object and establish the property

In sets, the product is the set of ordered pairs A x B. Use the coordinate projections and define <f,g>(x)=(f(x),g(x)). Both projection equations follow by reading the corresponding coordinate. Any function with those projections must return that same pair at every x, which proves uniqueness.

For the pullback, form the subset:

Q={(a,b) in A x B | s(a)=t(b)}.

The same pairing formula lands in Q exactly when the compatibility equation holds. Reading the coordinates again proves uniqueness. Q may be empty. The empty set is still a valid pullback in sets; it says no pair meets the stated compatibility requirement.

For a coproduct of sets, distinguish the two input branches with tags 0 and 1:

S=({0} x A) union ({1} x B).

The injections are iA(a)=(0,a) and iB(b)=(1,b). Define [f,g](0,a)=f(a) and [f,g](1,b)=g(b). Every element has one of these forms, which establishes existence and forces the rule uniquely. Even when A and B are the same set, the tags keep the two branches distinct. For A=B={0}, handlers f(0)=0 and g(0)=1 therefore extend to a function taking (0,0) to 0 and (1,0) to 1.

Additional structure – groups and topology. Establish that the object and maps have the chosen structure. For groups, define product multiplication componentwise. If f and g preserve multiplication, then their paired map does too, because each coordinate does. For a pullback of group homomorphisms, the compatibility equation is preserved by multiplication and inverses. A construction with continuous maps requires the appropriate topology and continuity arguments.

Use a known applicable construction when available. For quotient and generator questions, MATH.2 and MATH.5 provide the detailed operations. If the required object cannot yet be constructed, identify the unresolved existence or construction question. An existence theorem may supply a result for reasoning while leaving an effective way to obtain its elements for further work.

MATH.16:4.4 - Derive the next map, comparison or operation

Use the universal property to build the map the question needs. For a product, give the two component maps. For a pullback, also establish their agreement in C. For a coproduct, give a processing rule for each input kind.

The property also supplies equality tests. Two maps into a product or pullback are equal when both their projections agree. Two maps out of a coproduct are equal when composing each with iA gives equal maps and composing each with iB gives equal maps. This lets you compare an entire map through its required parts.

It can compare different constructions of the same object. If P and P’ satisfy the same product property for A and B, the projections of each determine a map to the other. Composing these maps preserves both projections. The identity does too, so uniqueness makes the composites identities. Thus the two constructions are isomorphic by the maps that preserve their projections. MATH.7 develops the transport of further structure when a usable bijection has been obtained.

A new operation on the components needs a compatibility test. Here take Q to be the pullback of sets and u:A -> A, v:B -> B to be functions proposing updates. They induce a function (a,b) -> (u(a),v(b)) on Q exactly when:

s(u(a))=t(v(b)) whenever s(a)=t(b).

The original agreement does not settle the changed one. A failed pair identifies which update or agreement condition must change. This gives a way to work on operations themselves while keeping their required uses visible.

Additional structure – groups. When the update must also be a homomorphism, establish preservation of the group operation. Agreement of the updated components alone establishes only a function on the set of compatible pairs.

MATH.16:4.5 - Use the result and return to a changed requirement

Return the construction with the maps and conditions needed by its consumer. A name such as “product” helps recognition; the projections, formation rule and applicable laws let the receiver use it.

For a mathematical question, stop with the required map, equality, usable construction or demonstrated obstruction. For computation, obtain the procedure and resources needed for the chosen representation through C.29.2. A finite pullback can be enumerated by testing pairs, while a large or infinite one needs an appropriate computational method.

For an application to another subject, C.29 supplies the correspondence that gives the mathematical objects and equations their subject meaning. In particular, a compatibility equation must represent the actual agreement needed by the work. A pairing of functions on one input describes a different operation from two executions that modify a shared input. For the latter use, first specify which values each step reads and changes, and which intervening steps are permitted. Use that account to decide whether a function construction represents the work; the pairing alone leaves those interactions unspecified.

When the question changes, return to the affected mapping requirement. Adding agreement can turn a product question into a pullback question. Needing to accept either input can call for a coproduct. Needing only selected answers can call for a quotient. Retain a useful earlier construction while its earlier question remains current.

MATH.16:5 - Archetypal Grounding

MATH.16:5.1 - Two classifications, then one shared integer

Two separately chosen integers have been classified. The first report gives its remainder modulo 2; the second gives its remainder modulo 4. The task is to combine the reports so that both can be recovered, and to add combined reports by adding their corresponding remainders. The two reports should determine the complete combined result.

Let A={0,1}, with addition reduced modulo 2, and B={0,1,2,3}, with addition reduced modulo 4. Adding the two reported numbers into one number loses recovery: reports (0,1) and (1,0) both give 1. Keeping a pair supplies both projections and requires no additional choice. All eight pairs are possible because the original integers may be chosen separately.

Now both reports must describe the same integer. The pair (0,1) fails: an integer with remainder 1 modulo 4 is odd. The modulo-4 report determines parity through t(b)=b modulo 2. Set s to the identity on A and construct the compatible pairs:

Q={(0,0),(1,1),(0,2),(1,3)}.

Every member comes from an integer. Addition stays within Q: (1,1)+(1,3)=(0,0). A report determines the original integer only modulo 4.

Additional structure – groups. With the stated modular additions, A and B are groups. The identity on A and the parity map t preserve addition, so Q with componentwise addition is also their pullback in groups.

The projection (a,b) -> b has inverse b -> (t(b),b). If the next calculation is easier with one modulo-4 value, MATH.7 transports it through these maps. If the next question is which integers may be identified while retaining both reports, MATH.2 instead constructs their quotient modulo 4.

Returning to functions on the underlying sets, a proposed update exposes another choice. Incrementing the modulo-4 component alone sends (0,0) to (0,1), outside Q. Incrementing both components gives (1,1) and preserves agreement for every pair in Q. The intended change to the underlying integer determines which component updates belong together.

Additional structure – groups. The joint increment is not a homomorphism: it takes the identity (0,0) to (1,1). It is suitable for updating the represented integer, but fails a requirement to preserve the group operation.

MATH.16:5.2 - Process both results or either result

One calculation returns an integer count; another returns a text label. A report containing both results needs a product. Its projections recover the count and the label, and the two values determine the report.

A different interface accepts either an integer count or a text label. It must display a count numerically and leave a text label as supplied. A tagged union, the coproduct of these sets, allows both handlers to determine one display function. An input tagged as a count follows the numeric handler; a text-tagged input follows the text handler.

The word “combine” did not decide which object to build. The question about formation and use did: recover two components from one report, or process either input through its own rule. These constructions describe values and functions. Whether executing the calculations reads or changes shared state is a further question about their execution.

MATH.16:5.3 - Two views of one quantity

A model has candidate states A and B for two component descriptions. Each description specifies the value of a shared quantity in C. For example, the two ends of an ideal connection may be required to have equal potential.

The product contains arbitrary state pairs. Requiring agreement selects the pullback of the two quantity maps. Its projections retain both component states, so a later calculation can still use their other quantities.

The physical account must justify the ideal connection and the meaning of that potential. If the connection has a relevant drop, the equality premise changes. A relation involving the drop and other quantities must be modeled before constructing its compatible states. The mathematical construction supplies the combination once that relation has been formulated; it does not choose the physical interaction law.

MATH.16:5.4 - Construct an object that can itself be applied

A function can be prepared by supplying a setting, then used with different inputs. We want a mathematical object representing the prepared function. Fix the input set A and output set B. A possible set of settings X supplies behavior eX:X x A -> B: it returns an output for a setting x and input a. Different X and eX describe different ways to prepare such behavior.

Seek a set E of prepared functions and an evaluation rule ev:E x A -> B for applying them. Preparing from a setting should give a map h:X -> E. To retain the original behavior, require:

ev(h(x),a)=eX(x,a) for every x and a.

Here prepared functions are equal when they give the same answer for every input. Thus the behavior specified by eX should determine h completely. Require a unique such h for every X and eX.

Construct E=B^A, the set of all functions from A to B. Define ev(k,a)=k(a), and let h(x) be the function sending a to eX(x,a). The required equation follows by evaluation. Any other proposed value for h(x) must give that same answer at every a, so it is the same function. This proves uniqueness.

For example, take A, B and X to be the integers and eX(n,a)=n+a. Then h(3) is the function that adds 3; ev(h(3),6)=9. The construction allows us to pass, apply and compare that function as an object. The conversion from a two-input function to a function returning a function is called currying. Distinguishing procedures with the same answers but different costs requires a further computational description of those procedures.

MATH.16:6 - Bias-Annotation

Recognizing a familiar construction can make its requirements seem inevitable. In :5.2 the same informal request to combine results leads to a product or a coproduct depending on the needed operation. Write that operation before naming the construction.

The set examples make existence easy to see. Other choices of objects and allowed maps can change existence or require additional structure. Carry that choice into the argument rather than relying on the appearance of paired entries.

MATH.16:7 - Conformance Checklist

  • The working question identifies what must be formed, recovered or compared.
  • Each map has a domain, codomain and meaning; its direction matches the required operation.
  • The permitted maps and their preservation conditions are stated.
  • Fixed objects are separated from the allowed varying instances of use.
  • The universal property identifies the supplied data, the comparison map for every allowed instance, its equations and why uniqueness is wanted.
  • A construction or applicable existence result supplies the object; a claimed construction has its existence and uniqueness arguments.
  • A changed requirement is reflected in the construction or its admissible maps.
  • Any computational or subject use obtains the additional operations and premises it needs.

MATH.16:8 - Common Anti-Patterns and How to Avoid Them

Recovery mistaken for full determination. Take A=B={0}. Recovering both components from A x B x {0,1} works, but forming an element also requires choosing 0 or 1. If only A and B should determine the result, require the unique combining map. If the extra choice is useful, name it as part of the input.

Compatible components processed incompatibly. A map on each component need not preserve their agreement. Test the equation in :4.4; the one-component increment in :5.1 supplies a failing case and its repair.

A familiar encoding chosen before its use. A pair and a tagged alternative support different functions. Recover the intended formation and processing operations before selecting either.

MATH.16:9 - Consequences

The result can be specified and compared through its permitted uses. Construction, extraction and equality arguments become connected, and a changed requirement identifies which mathematical work must be revisited.

The universal property leaves room for different implementations. Their mathematical correspondence can be established through the property, while their computational costs remain a separate reason for choosing one implementation.

MATH.16:10 - Architectural Rationale

Organizing the choice around maps makes the required operations explicit before committing to an encoding. Including uniqueness expresses when the supplied data determine the whole result. It also gives reusable arguments for comparing maps and comparing realizations.

A direct representation remains economical for a single familiar calculation. The universal-property method earns its additional abstraction when several constructions are plausible, a representation must be changed, or later maps and arguments need to be derived. The product, pullback and coproduct cases expose different requirements. The prepared-function case shows how to formulate another requirement by varying its settings and behavior while keeping the input and output sets fixed.

Detailed quotient, generator-extension and structure-transport methods remain separately usable. They supply constructions and proofs after this method has identified the needed property. This separation permits a broader choice method without compressing those techniques into unexplained instructions.

MATH.16:11 - SoTA-Echoing

For choosing an object through the maps it must support, the adopted line is universal construction in category theory. Riehl’s Category Theory in Context, §§2.3, 3.1 and 3.2, gives the general account and concrete set constructions. The present method uses that line to move from a working requirement to a construction, then to its derived maps and equality arguments.

Fong and Spivak’s Seven Sketches in Compositionality, especially the chapter on databases and categories, develops the use of these constructions across applications. Its contribution here is the attention to what transformations and queries the constructed object supports. Example 3.72 supplies the function-as-object construction through currying used in :5.4.

At comparable effort, a direct pair or tagged union is often enough when the operation is already settled. Use the universal account when the ambiguity or later reasoning makes it useful. A more elaborate categorical description adds no benefit to a calculation whose relevant conditions and result are already clear.

The elementary examples use ordinary equality and functions. If the work changes the permitted maps or the meaning of equality, reformulate the comparison and its equations in that setting. A requirement to compute the result can also reopen the choice of construction.

MATH.16:12 - Relations

  • MATH.1 constructs composable paths when the required object retains generating steps and their order.
  • MATH.2 constructs quotients while preserving the selected operations and answers.
  • MATH.5 extends generator assignments to operation-preserving maps and proves their uniqueness.
  • MATH.7 transports structure through a bijection when a different representation is useful.
  • B.5.FM and B.5.TU connect the working question, construction and use at the common reasoning level.
  • C.29 and C.29.2 supply subject correspondence and computational formulation.

MATH.16:End

MATH.17 - Construct Mathematical Spaces of Operations and Operations on Them

Type: Method Status: Usable, evolving Normativity: Normative

MATH.17:1 - Problem frame

Use this pattern when the rule for constructing or transforming something has itself become the object of work. You may need to combine allowable rules, apply a rule to a different kind of input, compare ways of repeating it, or change the rule while retaining a useful property. Knowing how to execute each individual rule leaves these questions open.

Start with the operation you want to perform on rules and the consequence you need from it. For example: “Can these permitted updates be composed?” or “Can I transform each stage separately and obtain the same result as transforming their composite?” One constructed operation, together with its applicability and the law or counterexample that answers that question, is a useful result.

Here a space of operations is a specified collection of operations with the equality, composition and further structure needed by the question. The main route uses sets and functions; it requires understanding function application, composition, sets and elementary equality arguments. MATH.16 explains functions as mathematical objects, evaluation and currying. The polynomial example is an optional branch using polynomial arithmetic.

Use an existing rule directly when its application settles the question. Construct a space of operations when you need to reason about, generate or change rules. A topology, metric or order on that space becomes part of the construction when the question needs continuity, approximation or comparison in that sense.

MATH.17:2 - Problem

An operation can be permissible on its own yet leave the permitted class when combined with another. A transformation of operations can produce a valid operation yet alter the result of a sequence. These failures occur at different places: membership, composition, or the proposed transformation.

To locate the failure, specify the rule’s domain, construction and relevant laws. These supply the mathematical questions: which operations belong to the permitted collection, what can be done with them, and which conclusions follow?

MATH.17:3 - Forces

ForceTension
Individual applicability and compositionTwo allowable operations can have a composite that violates the condition used to select them.
Useful abstraction and needed distinctionsFunctions expose input-output behavior; questions about construction steps or cost need a representation retaining those distinctions.
Changing rules and retaining consequencesA higher-order operation may preserve some laws, replace others, or require a narrower domain.
Uniform construction and branch-specific structureOne construction can work across many sets, while continuity, differentiability or other additional requirements need their own arguments.

MATH.17:4 - Solution

Local mantra: state the change to the rule; construct its admissible inputs; establish composition; construct the higher-order operation; derive its consequence; use or revise it.

MATH.17:4.1 - Specify the operations and the question about them

Name the inputs and outputs of an operation. Write f:A -> B when f assigns an element of B to every element of A. Write g∘f for “first f, then g”; it is defined when f’s output is an allowed input to g.

Choose what counts as equality for the present question. In the main function route, f and g are equal when they have the same domain and codomain and f(x)=g(x) for every input x. If the question concerns the steps used, resource cost or another distinction between ways of producing that function, retain a construction or program representation carrying that distinction. A function value alone leaves it unavailable. MATH.1 supplies constructions retaining ordered steps; MATH.2 handles an identification when the needed operations respect it.

Formulate the intended operation on rules. It might take two operations and compose them, send an operation on individual inputs to an operation on collections, or turn an expression for a function into another expression. State which result matters: admissibility, an identity, a comparison, a changed construction, or a failed requirement.

MATH.17:4.2 - Construct the admissible collections

For each relevant pair A, B, specify Adm(A,B), the collection of operations allowed from A to B. Give a condition that can be used to establish membership. Examples include preserving an order, maintaining a relation between components, or mapping a designated subset into itself.

When the operations are functions, MATH.16 supplies the function object and evaluation ev(f,x)=f(x). Restrict that object by the required condition. A rule with several inputs can be represented by a function on their product when a tuple contains all the inputs it needs.

For a partial operation, include its domain of definition. If f is defined on D within A and g on E within B, their composite is defined on {x in D | f(x) in E}. Whether this is an acceptable domain belongs to the current question.

Changing the admissibility condition changes the collection. An update preserving a set of possible states and a map preserving an algebraic operation answer different requirements. State the requirement before using either as an admissible rule.

MATH.17:4.3 - Establish the composition that the work needs

Try to construct:

Adm(B,C) x Adm(A,B) -> Adm(A,C), (g,f) -> g∘f.

The formula already defines a function composite. To obtain the displayed operation, establish that the composite satisfies the selected admissibility condition. Establish identity membership when doing nothing must be an allowable operation. Associativity then follows from function composition.

For example, fix a subset P of X and admit every f:X -> X with f(P) contained in P. If f and g are admitted and x lies in P, then f(x) lies in P and g(f(x)) lies in P. Thus their composite is admitted, as is the identity. These operations form a monoid: a set with associative composition and an identity. Several object types with identities and compatible associative composition form a category. These names make the established structure reusable.

If closure fails, use the failing input or pair to choose the repair. You might restrict the operations, enlarge the permitted result class, or keep a sequence of operations whose total admissibility is checked separately. For a cumulative resource bound, for example, retain the sequence and accumulated cost needed to assess the whole. Calling each step allowable leaves that total unresolved.

An interchange of steps is another claim. Establish g∘f=f∘g when a proposed reordering needs it; associativity by itself only changes the grouping of a fixed order.

MATH.17:4.4 - Construct an operation on operations and its law

Give the higher-order operation its own input and output types. For a transformation sending a function f to a new function T(f), start with an arbitrary input x of the desired new function. Express its required output using f and the available operations. That expression defines T(f)(x). Then establish that the constructed function belongs to the promised output collection.

Choose the law from the needed use. If T is meant to translate a sequence stage by stage, test:

T(g∘f)=T(g)∘T(f) and T(id)=id.

The types on both sides must agree. When T also changes the objects, specify that object assignment and the corresponding operation collections. An assignment preserving these compositions and identities is a functor.

For instance, we want to apply f:A -> B separately to each entry indexed by a fixed set I. Represent the input by s:I -> A; the set of such inputs is A^I. At index i the input is s(i), so the required output is f(s(i)). Collecting these outputs gives the function i -> f(s(i)) from I to B. We have constructed:

L_I(f):A^I -> B^I, defined by [L_I(f)(s)](i)=f(s(i)).

To derive the composition law, take arbitrary s and i:

[L_I(g∘f)(s)](i)=g(f(s(i)))=[(L_I(g)∘L_I(f))(s)](i).

Equality at every index proves the composition law. The identity law follows by applying the identity at every index. If admissibility requires each entry to remain in P, the earlier membership argument applies entry by entry. A condition relating different entries needs a further preservation argument.

A different higher-order operation can have a different useful law. Differentiation of polynomials preserves sums and scalar multiples and obeys the product and chain rules. Use those laws when deriving a derivative; a composition-preservation requirement would ask it to do a different job. The needed mathematical operation determines which laws to establish.

MATH.17:4.5 - Use the construction to change or compare rules

Compute the proposed changed operation and derive the consequence that motivated it. When comparing “transform each step” with “transform the whole”, keep both expressions until their equality is established or a separating input is found.

The result consists of the usable construction and the conditions supporting the particular consequence. For a finite example, a counterexample can settle a failed universal claim. A general preservation claim needs an argument over its stated inputs.

Return to the affected condition when the task changes. A new interaction between entries may invalidate pointwise lifting. A narrower resource budget may invalidate closure. A new question about how the operation was obtained may require retaining the construction that an input-output function discarded.

When this mathematics describes a working method, use C.29’s correspondence to identify what the mathematical operations represent and which practical distinctions they retain. A proposed program transformation also needs its execution semantics. Those connections let the result inform actual work while keeping the mathematical and subject claims recoverable.

MATH.17:5 - Archetypal Grounding

MATH.17:5.1 - Individually permitted changes and a permitted whole

Let X={0,1} x {0,1}. An update is allowed to change at most one coordinate of each input pair. Flipping the first coordinate is allowed; flipping the second is allowed. Their composite sends (0,0) to (1,1) and changes two coordinates. The proposed collection is not closed under composition.

If the requirement limits each elementary step, keep a sequence of these steps and inspect intermediate states. If it limits the difference between initial and final states, test the composite against that bound and reject this pair. The same counterexample distinguishes the two intended uses.

Now take another requirement: the two coordinates must stay equal. Put P={(0,0),(1,1)} and admit functions sending P into P. The joint flip belongs; either single-coordinate flip fails. Closure follows from :4.3. This change of admissibility supplies a composable class suited to the equality requirement.

MATH.17:5.2 - Lift a rule, then change how repetition is distributed

Take integer operations f(n)=n+1 and g(n)=2n. Pointwise lifting to pairs is the case I={1,2}. Applied to (1,3), the lifted composite produces (4,8). Lifting f and g separately and then composing produces the same pair. The proof in :4.4 establishes that agreement for arbitrary inputs and functions.

Consider a different change: S(h)=h∘h, meaning repeat an operation twice. This always gives another integer endofunction, but the two sequencing proposals give:

S(g∘f)(n)=4n+6;

(S(g)∘S(f))(n)=4n+8.

At n=0 the answers are 6 and 8. To repeat the complete sequence, retain (g∘f)∘(g∘f). To run each stage twice, use g∘g∘f∘f. If f and g commute, rearrangement proves the two proposals equal; the present f and g do not.

The construction therefore returns both a valid operation on operations and a failed composition-preservation claim. That failure determines which changed rule implements the intended repetition.

MATH.17:5.3 - An operator whose useful law has another form

Let P=R[x], the real-coefficient polynomials in one variable, and define D:P -> P by differentiating each monomial: D(a*x^n)=n*a*x^(n-1) for n>0, and D(a)=0 for constants. This constructs an operation on functions through their polynomial expressions.

For p=x^2 and q=x+1:

D(p*q)=3*x^2+2*x.

The product of derivatives is D(p)*D(q)=2*x. The applicable law is instead:

D(p*q)=D(p)*q+p*D(q),

which gives the required result. To establish the law generally, first expand two monomials: differentiating a*b*x^(m+n) gives coefficient (m+n)*a*b, the sum of the two product-rule contributions. Distributing over the finite sums proves it for polynomials.

The same method of working is used as in :5.2: construct the operator, identify the law needed for the proposed use, and establish that law. Here it enables transforming a product expression into its derivative.

MATH.17:5.4 - Change a function while preserving its increments

Given a function f from the real numbers to the real numbers and a chosen point c, construct a function g that fixes c and preserves every increment of f. The requirements are g(c)=c and g(x)-g(y)=f(x)-f(y) for every x,y.

Set y=c in the second requirement. It forces g(x)=f(x)-f(c)+c. This defines a real-valued function; substituting c establishes the fixed point, and subtracting its values at x and y cancels the added constant and preserves the required increment. Thus the formula supplies the unique function under these requirements.

The transformation takes f itself as an input and returns g. Fixing a point and preserving increments do not settle an additional question about composition or cost. The repetition case in :5.2 shows how different requested changes lead to different operations on the same input rules.

MATH.17:6 - Bias-Annotation

A familiar collection of “valid operations” can conceal an unproved closure claim. A familiar higher-order operation can conceal the choice of law used to combine its results. Work with the actual membership condition and proposed equation; the failing inputs in :5.1 and :5.2 locate those different errors.

The set-and-function route makes these questions accessible. A question involving topology, approximation, randomness or an alternative equality calls for the corresponding additional structure and argument.

MATH.17:7 - Conformance Checklist

For the construction being used:

  • The operations have recoverable inputs, outputs, equality and admissibility conditions.
  • The needed compositions land in the claimed collection, or a concrete failure has changed the proposed use.
  • The higher-order operation has a construction and returns an admissible output.
  • Each law used to derive the result has the required scope and an argument; a tested finite case supports only what it establishes.
  • The resulting comparison or changed rule answers the starting question.
  • A subject or computational application supplies the correspondence or execution account needed by that use.

MATH.17:8 - Common Anti-Patterns and How to Avoid Them

Inferring closure from individual permission. The two flips in :5.1 each meet the step condition but fail it when composed. Decide whether the requirement concerns a step, a sequence or the whole input-output change, and construct the corresponding collection.

Moving a transformation through composition without its law. Repeating each stage twice changed the answer in :5.2. Derive the transformation equation before using it to reorganize a sequence.

Demanding the wrong preservation law. Polynomial differentiation supplies a useful operator through linearity and the product rule. Choose the law from the intended transformation instead of requiring every operator to preserve multiplication or composition.

MATH.17:9 - Consequences

Operations become available for construction, comparison and change. A law established for the higher-order construction can replace repeated case-by-case reasoning, while a counterexample can identify a proposed change that needs revision.

The abstraction has a cost: the operation collection and its laws must be constructed. It pays when the rule itself is changing or when one result will organize many operations. Questions about implementation, approximation or real interaction can require further structure beyond the function account.

MATH.17:10 - Architectural Rationale

Separating membership, closure and higher-order transformation locates three different sources of failure. Combining them into a generic instruction to “check composition” would leave the repair unclear.

MATH.16 supplies the function-object construction. Here the practitioner selects a collection of allowable operations and constructs further operations whose arguments are members of that collection. Monoid and category language make the established composition reusable; the derivative example shows why other higher-order operations need other laws. The choice follows the problem about rules.

The same structure can support mathematical work, computational transformations and mathematical accounts of methods. Its applicability in the latter two depends on the interpretation of operations and consequences, which remains the responsibility of the receiving method.

MATH.17:11 - SoTA-Echoing

Riehl’s Category Theory in Context, §§1.1 and 1.3, supplies the algebraic account of composable maps, monoids and functors. The adopted contribution is the ability to study transformations of operations by their preserved structure. This pattern turns that account into a method for selecting admissible operations, finding a failed closure condition and constructing the transformation required by the question.

A direct formula is sufficient when one operation settles the task. The structured account helps when rules must be combined or changed. Polynomial operators illustrate the alternative: linearity and a product rule may provide the useful calculus even when composition preservation is inapplicable. Additional mathematical structure is selected by the needed consequence.

MATH.17:12 - Relations

  • MATH.16 constructs function objects, evaluation, products and maps selected by their required uses.
  • MATH.1 retains generating steps and their order; MATH.5 extends an assignment to generators through the operations it must preserve.
  • MATH.2 establishes when an identification of operations supports the proposed further operations.
  • MATH.7 transports structure through a bijection. Comparing broader mathematical accounts uses interpretations of their objects, operations and assertions.
  • MATH.11 and MATH.13 develop invariant and symmetry consequences once the transformations are specified.
  • B.5.FM, C.29 and C.29.2 connect the mathematical construction with a working question, subject correspondence and computational use.

MATH.17:End

MATH.1 - Build a Mathematical Structure of Composable Paths

Type: Method Status: Usable, evolving Normativity: Normative

MATH.1:1 - Problem frame

Use this pattern when you know elementary steps and their permitted connections, but still need mathematical objects for their finite combinations. Typical questions are: which steps form a permitted sequence, how can two sequences be joined, and which distinctions must remain available for a later operation?

The construction below makes paths from generating arrows. An arrow has a starting object and an ending object; these can be states, types or mathematical objects. A path is a finite ordered list of arrows whose adjacent endpoints agree. The resulting structure can describe formal words as well as possible routes through a process. Its mathematical laws come from the construction.

Start by writing two steps you want to join and their endpoints. If the first ends where the second starts, their ordered pair is already a useful first path. If the written endpoint hides a condition that changes whether the second step is available, refine the endpoint before joining them.

You need elementary sets, ordered lists and equality. If an existing structure already supplies the combinations and distinctions your question needs, use its operations directly. This pattern is useful when constructing or changing those operations is itself the difficulty.

MATH.1:2 - Problem

A list of elementary steps leaves the composite objects and their operations undecided. Joining names that merely look compatible can produce a combination that the generating rules do not permit. Collapsing two paths to the same endpoint can also erase their different steps, costs or available continuations.

The mathematical task is to construct the combinations, define when composition is possible, and establish the laws that follow. The result should let another person or computational agent reproduce a path and reason about a longer combination from its parts.

MATH.1:3 - Forces

ForceTension
Finite description and unbounded reuseA few generators can produce arbitrarily long paths; listing all paths is usually impossible.
Keeping distinctions and economical reasoningRemembering the generators preserves information, while a later question may need only a quotient or a numerical value.
Local compatibility and later useAn endpoint sufficient for today’s composition may hide a condition needed by a changed continuation.
Composition and interpretationConcatenation has laws by construction; a physical or computational interpretation has further conditions of its own.

MATH.1:4 - Solution

Local mantra: name the endpoints; form paths; join matching paths; use the composition laws; retain the distinction needed by the next operation.

MATH.1:4.1 - Choose objects and generating arrows

Write the objects at which the elementary steps start and end. For each generator a, give a source s(a) and a target t(a). Several generators may have the same source and target.

Include conditions that determine the availability of the selected continuations. A location may be enough for one problem; another may require a pair such as (location, permission). Use a failed attempted continuation to find the needed distinction. There is no requirement to anticipate every possible future operation.

The generating arrows and endpoints form a directed graph in the mathematical sense. A drawing can display it, but the vertices, arrows and endpoint functions define the structure. A physical network or an organization’s work may be interpreted through this graph; that application supplies its own claims about what the arrows can represent.

MATH.1:4.2 - Form finite paths

A path of length n>0 is a list [a1,…,an] with t(ai)=s(a(i+1)) for every adjacent pair. Its source is s(a1) and its target is t(an).

At each object x, add an empty path id_x. It starts and ends at x and contains no generator. Keeping its object matters: the empty path at one object cannot serve as the identity at another.

Initially, two nonempty paths are equal when their lists contain the same generators in the same order. The empty paths are equal only at the same object. This choice retains the sequence used to construct the path. A later identification can deliberately forget part of it, using MATH.2.

Construct only the paths needed for the immediate question, or describe a family by its formation rule. Cycles make infinitely many paths possible, but each path remains finite.

MATH.1:4.3 - Define composition by concatenation

For paths p:x→y and q:y→z, write p;q for the path obtained by putting the list of q after the list of p. Here the semicolon is read in execution order: first p, then q.

Composition is defined when the full intermediate object agrees. Its source is x and its target is z. If the endpoints disagree, repair the proposed sequence, supply a connecting arrow that is actually permitted, or return the failed connection.

Concatenation gives two laws:

  • id_x;p=p=p;id_y for p:x→y, because an empty list adds no generator.
  • (p;q);r=p;(q;r) for three consecutively composable paths, because both sides contain the same three lists in the same order.

These arguments establish identity and associativity for this construction. They can be reused while the definitions stay unchanged. They leave the order of the generators intact: p;q and q;p can differ or one can be undefined. A structure with objects, arrows and these laws is a category; the path construction gives the free category on the generating graph.

MATH.1:4.4 - Use the path at the needed level

Return the path that answers the immediate composition question, or the formation and composition rules when the receiving work needs a reusable family.

If each generator has a supplied additive cost, obtain a path’s cost by adding the costs of its generators; the empty path has cost zero. Keep the path as well when the receiver needs to execute it or inspect why it is available. Two paths with the same cost can contain different generators.

If a representation hides an intermediate object, test the attempted composition that made the distinction matter. Refine the objects or retain the paths until the subsequent operation is well defined. MATH.2 constructs an identification that preserves selected operations; it can later reduce the structure deliberately.

An interpretation can associate generators with transformations in another setting. The mathematical path then specifies their composition. Whether those transformations are available and adequate in that setting is the application’s question, using such common methods as FPF C.29 and B.5.MPC.

Stop when the receiving question has a permitted path, a reusable construction, or a specific failed connection. Constructing every possible path or proving an unchanged concatenation law again adds no result to that use.

MATH.1:5 - Archetypal Grounding

MATH.1:5.1 - A continuation that needs a permission

Two routes p and q start at S and reach location V; their costs are 1 and 4. A final step r costs 2. Under the first rule, r is available after either route, so p;r and q;r are paths and their costs are 3 and 6.

Now change the rule: only q grants the permission needed for r. Keeping a single endpoint V would still make p;r appear composable.

Construct two intermediate objects, V0=(V,0) and V1=(V,1). Set:

GeneratorSourceTargetCost
pSV01
qSV14
rV1T2

The path q;r exists and costs 6. The expression p;r fails the endpoint test. Selecting the cheaper prefix first would therefore lose the available completion. The useful result is the permitted path and its cost; the refined endpoint explains why it is permitted.

If a further generator a:V0→V1 grants permission at cost 1, a new path p;a;r becomes available at cost 4. The former failure has opened a construction question: what additional arrow would connect the available prefix to the required continuation?

MATH.1:5.2 - Natural numbers from repetition

Take one object X and one generating loop a:X→X. The paths are the empty word, a, a;a, and longer repetitions. Write a^n for the list containing n copies, with a^0=id_X.

Concatenating a^m and a^n gives a^(m+n). Thus lengths supply an arithmetic account of this structure: the identity corresponds to 0 and composition corresponds to addition. Every path is determined by its length in this one-generator case.

Adding a second loop b changes the situation. The paths a;b and b;a both have length 2 but are different lists. Counting generators now loses their order. It still answers a length question; a question about which generator acts first requires the path.

MATH.1:5.3 - Order matters under interpretation

On integers let f(x)=x+1 and g(x)=2*x. Both generators start and end in the integer type, so both orders are composable. Starting from 0, f;g returns 2, while g;f returns 1.

The associativity argument allows regrouping a longer list. It does not authorize exchanging f and g. The differing results make that boundary consequential.

MATH.1:5.4 - Keep the intermediate states of interacting updates

Two updates to a counter each read its current value, retain that reading and later write the reading plus one. From zero, finishing one update before the other gives two. If both read zero before either writes, the final value is one.

To represent the difference, a state retains the counter, each update’s saved reading and whether its read and write have occurred. A read copies the counter into that update’s saved value; its later write replaces the counter by that saved value plus one. Form paths in which each read precedes its own write. The paths read-A, write-A, read-B, write-B and read-A, read-B, write-A, write-B return two and one respectively.

Treating each update as one indivisible arrow would lose the second path. If the work can require one complete update to finish before the other, the restricted paths preserve both increments. FPF C.29 establishes how these transitions describe the implemented work; Method Engineering ME.7 helps change its composition. Choosing an implementation also depends on how it handles waiting, interruption and failure.

MATH.1:6 - Bias-Annotation

A familiar drawing can make location seem like the whole state. The permission case exposes the omitted condition through a failed continuation, then repairs the mathematical object.

The construction also favors retaining history. This is useful while the role of the generators is unsettled, but it can be unnecessarily expensive when only a value or an equivalence class is needed. Use the subsequent quotient or evaluation deliberately, stating the operation or question it preserves.

MATH.1:7 - Conformance Checklist

  • Can the reader identify each generator’s source and target?
  • Does each constructed path satisfy the adjacent-endpoint condition, including any action-changing refinement such as permission?
  • Are empty paths attached to their objects and composition defined in one stated order?
  • Are the claimed identity and associativity laws supported by the construction used?
  • Does the returned path retain the detail required by its next use? If only a cost, length or class is returned, is that sufficient for the receiving question?
  • When a connection fails, is the missing or incompatible endpoint recoverable without inventing an available generator?

These questions assess the construction in use. They do not require a separate record for each path.

MATH.1:8 - Common Anti-Patterns and How to Avoid Them

Join by location while losing an enabling condition. In :5.1, replacing V0 and V1 by V creates an apparent connection that the permission rule excludes. Restore the condition in the intermediate object and try the composition again.

Use a path value as a substitute for a path. The same length can describe a;b and b;a. Return the list when order matters; return the value when the question only consumes that value.

Read associativity as permission to reorder. Parentheses choose grouping. They leave generator order unchanged, as the f;g example shows.

MATH.1:9 - Consequences

The construction turns elementary connections into reusable mathematical objects and an operation on them. It provides a witness for a permitted combination and a precise location for a failed one. Different contributors can prepare subpaths and compose them at shared endpoints.

Retaining all generator lists can produce a much larger structure than the final question needs. A quotient can remove selected distinctions; a cost calculation can compare alternatives. Each reduction has to preserve what its receiving use consumes.

A new continuation may reveal an inadequate object description. The repair then changes the endpoint distinction and the affected paths, while unchanged generating rules and concatenation arguments remain reusable.

MATH.1:10 - Architectural Rationale

Generating first and identifying later separates two mathematical decisions: which composites exist and which of them count as the same. It gives a small constructive starting point when an application or theory has elementary steps but no satisfactory account of their combinations.

The empty path and endpoint conditions make composition uniform. An already completed segment can be treated like an elementary arrow in a larger composition. This is why the same construction supports words, typed transformations and possible routes through a process.

A concrete transformation structure can be more economical when only its resulting transformations matter. Paths earn their additional detail when the sequence, its formation conditions or its later reinterpretation affects the answer. The examples expose both uses: one generator is recoverable from length, while two generators can lose consequential order.

This method constructs a particular mathematical structure. FPF B.5.RC helps recover a construction already described, and C.29 helps relate a mathematical structure to another subject. Their results can be used before or after this construction.

MATH.1:11 - SoTA-Echoing

Question: how can permitted elementary connections generate reusable composites while retaining their order and formation conditions?