With empty objects allowed, finite totally ordered sets and all weak order-preserving functions give a presheaf classifier for weak total orders. Finite tuples in a model can locally be merged into a sorted tuple using finitely many totality disjunctions. Equalizing two maps between finite chains amounts to collapsing the convex intervals forced equal. These two constructions give the flatness conditions without assuming decidable equality.
Hahn group 2026-10-14
For a totally ordered set , take real coefficient families whose support satisfies the maximum condition: every nonempty subset of the support has a largest index. Add coefficients pointwise and decide the sign from the largest nonzero coordinate. This defines an ordered Abelian group. For with its usual order, the maximum condition forces finite support. Some presentations reverse the index order and use a minimum instead; specify the convention when applying an embedding theorem.
Every lattice-ordered group embeds in a lattice-ordered permutation group on one totally ordered set. Choose a value in a lattice-ordered group for each nonidentity element, act on its ordered right cosets, and combine these chains in an order sum. The original element moves its own value's identity coset, making the action faithful. The coset lattice formulas make the embedding preserve both join and meet.
Increasing subsequence Created 2026-09-28 Updated 2026-10-13
An increasing subsequence of a finite sequence in a totally ordered set selects indices such that
Here “increasing” means weakly increasing, also called nondecreasing: equal values are allowed, but indices must increase strictly. This is the convention of [ref]. A strictly increasing subsequence instead requires . Always check which convention an algorithm uses, especially when values repeat.
An increasing subsequence may skip positions; it neither rearranges values nor requires consecutive positions. Consider the deliberately constructed example
The indices select , an increasing subsequence of length four. The indices select , a strictly increasing subsequence of length three. In contrast, rearranges the input and is not a subsequence. The longest consecutive nondecreasing block is , of length three; requiring consecutive positions would therefore solve a different problem.
Think of an increasing subsequence as preserving ordered observations while skipping interruptions. For the example, discarding leaves four observations with no downward step. The longest increasing subsequence asks how much of the original order can be kept. This is an order comparison, rather than a claim about the size of upward or downward changes: replacing all values by their squares when the values are nonnegative leaves every allowed selection unchanged. More generally, any strictly order-preserving relabeling has this property.
A group of order automorphisms of a totally ordered set that is closed under pointwise maximum and minimum. Products act on the right when writing ; then . The pointwise lattice operations make it a lattice-ordered group.
Longest increasing subsequence Created 2026-09-28 Updated 2026-10-14
A longest increasing subsequence is an increasing subsequence of maximum length. Write that length as , with for the empty sequence; a nonempty input has . Several selections can attain the same maximum. Here uses the weak convention ; write for the maximum length of a strictly increasing subsequence. For , these lengths are three and one respectively; for an input with distinct values they agree.
For , the answer is , attained at indices , while . One useful interpretation is the smallest number of deletions needed to make the surviving sequence nondecreasing:
Indeed, keeping a longest increasing subsequence attains this bound, and any valid remaining sequence is an increasing subsequence, so cannot have more than terms. In this example the answer is . This makes a measure of how much order can be recovered without moving any observation.
A table that ends at each position. Let be the maximum length of an increasing subsequence ending specifically at position . The dynamic programming recurrence relation is
The zero covers a selection consisting only of . Otherwise its penultimate index is an eligible ; append to an optimal selection ending there. Fill entries in increasing index order. For strictly increasing subsequences, change the comparison to . The strict version and reconstruction are developed in University of Toronto, CSC373 tutorial 4 solutions (2018), exercise 2; the weak version follows by allowing equality at the append step.
In the worked input, the weak table is and the strict table is . At the second , equality extends the first in the weak table. The final entry is only one, although the optimum is four: the best increasing subsequence need not finish at the last input position. Record a maximizing predecessor whenever . Following these stored indices from any position maximizing , then reversing them, gives an actual longest increasing subsequence. For the weak example the backward chain is .
Figure 1.
Skipping positions and allowing equal values changes the optimum
. An original toy input, not measured data. The colored selection keeps indices and values . The two dynamic programming rows give the best lengths ending at every position; the backward arrows reconstruct the weak longest increasing subsequence. Details.
Scanning all earlier positions for each uses time complexity and space complexity for lengths and predecessors, using Big O notation and assuming constant-time comparisons and operations on indices.
Keep the easiest ending to extend. The faster algorithm maintains a minimum-tail table for increasing subsequences: is the smallest final value of any length- increasing subsequence in the processed prefix. For equal lengths, a smaller ending permits every future extension allowed by a larger ending. Thus only one best ending per length is needed. The table is nondecreasing, since removing the last term of a length- selection gives . Start with an empty table. On reading , use binary search to find the first entry strictly greater than : replace it by , or append if there is no such entry. Its position is one beyond the longest existing length whose ending is at most . See Liben-Nowell, Vee and Zhu, section 3.1 and Figure 1.
Duplicates determine the binary search rule: weak increase replaces the first , whereas strict increase replaces the first . In Python these positions are returned by bisect_right(T, v) and bisect_left(T, v) respectively, counting positions from zero. Replace an entry or append; do not insert and shift the remaining entries. The documented equality rules are in Python documentation, bisect_left and bisect_right. Each search takes comparisons, giving time complexity , conventionally for , and space complexity for the weak length alone.
Figure 2.
Two binary-search tie rules give different minimum-tail tables
. Original exact traces for the same toy input, not measured data. Each cell shows a tail value and the input index supplying it; the outlined cell was updated in that row. At the second , the weak algorithm appends and the strict algorithm replaces. The final weak table has length four, but its supplier indices are not in increasing order. Details.
A length certificate needs separate reconstruction. The final weak tail values are , but they do not form an increasing subsequence of this input: the zero occurs last. Each table entry certifies a selection of its own length; the entries need not come from one compatible selection. To recover a longest increasing subsequence during the fast algorithm, store a supplier index for each tail and a predecessor index for each input position. Before replacing slot , save , or no predecessor if , then set . Later replacements leave saved unchanged. Follow predecessors from the final and reverse. This uses space complexity and returns indices for the weak trace. The same construction works with the strict comparator; compare the two auxiliary arrays in CP Algorithms contributors, restoring the subsequence after binary search.
Deleting or changing one term. If deletes position , then
Deleting cannot create a longer increasing subsequence; removing position from a previously optimal selection loses at most one term. If instead changes just the value at position , both inputs have the same deleted sequence, so their lengths each lie between its length and its length plus one. Consequently . These bounds also hold for strictly increasing subsequences. In the weak example, deleting either lowers the length to three, while deleting the final zero leaves it four. This is a Lipschitz bound for single-term edits, regardless of the numerical size of a replacement. Insertion has the same bound by reversing deletion, so insertions, deletions or replacements can change by at most .
For historical context, [ref] studies the comparison count for distinct elements of a totally ordered set. Its distinctness assumption makes the weak and strict conventions coincide. No distinctness assumption is needed for the comparator-specific algorithms above.
A minimum of is a member of less than or equal to every member of . It equals the infimum when that lower bound is attained. A nonempty finite subset of a totally ordered set has a minimum; a nonempty open real interval does not.
For each , choose a value in a lattice-ordered group , using Zorn's lemma. Such a value is a prime convex lattice subgroup. Otherwise the last construction in Question 1(i) would give two larger convex lattice subgroups whose intersection is ; maximality among subgroups omitting would put in both, hence in their intersection. Thus the right coset set is a totally ordered set.
Right multiplication defines an action . It is well-defined, preserves the total order, and has inverse . The coset formulas from Question 1(i) show pointwise preservation of both join and meet, because
and likewise for the meet.
Take the disjoint union of these chains, arranged in any fixed order sum of the indices . Let every act on each component by . This gives a lattice-ordered group homomorphism into the order automorphisms of one chain. It is injective: a nonidentity moves the identity coset in , since . Its image is closed under pointwise join and meet, giving exactly the required lattice-ordered permutation group. This is the Holland representation theorem.
Let be a small skeleton of finite partially ordered sets with all weak order-preserving functions, and let consist of finite strict partial orders with all strict order-preserving functions. Include the empty structure, because no inhabitation axiom has been imposed. The two classifiers are
These are covariant functor categories, or presheaves on the opposite finite-model categories; reversing this variance would give the wrong generic models. In each case the generic carrier sends a finite model to its underlying set, with the generic relation given by its order at that stage. These are the classifying topos of partial orders and the classifying topos of strict partial orders.
We justify the finite-model presentations internally, so an identification of set-based model categories alone is not being mistaken for a classifying property. A finite weak-order presentation takes a finite graph of required inequalities, closes it transitively and reflexively, and identifies vertices in mutually reachable cycles; this produces a finite poset representing that positive diagram. For the strict theory, a transitive cycle makes the presentation contradictory by irreflexivity; otherwise transitive closure produces a finite strict poset. Homomorphisms from these presentations into any model are exactly the tuples satisfying the specified finite relations.
More explicitly, an internal model gives on the opposite finite-model category. Its finite realizations form an internally filtered system. It is nonempty through the empty presentation. Two realizations combine through a disjoint-union presentation. To equalize parallel presentation maps whose composites in agree, quotient their target by the finitely many required identifications and close the relation transitively. In the weak case, collapse the resulting mutually comparable blocks; antisymmetry in guarantees that the realization factors through this quotient. In the strict case, either the quotient is a finite strict poset and gives the required factorization, or it has a cycle, making the supposed realization impossible. These constructions prove the flatness conditions without deciding equality of arbitrary elements of .
Conversely a flat functor gives an internal filtered colimit of finite models with the indicated carrier and relation. Each finite axiom remains true under that filtered presentation. One-point presentations recover every element; two-point comparison presentations recover every relation; and finite identifications recover equality. These constructions are inverse: a realization of any finite diagram in the colimit factors locally through a finite stage, and two such realizations agreeing in the colimit agree after a further stage. Thus internal models in every Grothendieck topos correspond to flat functors on the opposite finite-model category. The presheaf case of the Diaconescu equivalence for geometric morphisms gives the displayed classifiers. This direct finite-presentation argument is the relevant safeguard in identifying presheaf classifiers; agreement of set-model categories by itself would not suffice, as emphasized in Research on theories of presheaf type.
The reflexification of a strict partial order interprets the weak theory by
Reflexivity is supplied by the equality disjunct. For transitivity, distribute over the two disjunctions: a pair of strict comparisons composes by strict transitivity, and any equality substitutes into the other comparison. For antisymmetry, the case of two opposed strict comparisons implies and hence falsity; every remaining case supplies equality. All these are coherent deductions, so the interpretation works in an arbitrary topos rather than only in classical sets.
It gives a functor and hence a geometric morphism
This applies Question 5 to on the presheaf indexing categories. Every finite weak poset is the reflexification of its classical strict part, so every target indexing object is in the image. Question 5(ii) therefore makes surjective. But is not full: the constant map from a two-element chain to a singleton is weak-order-preserving and not strict-order-preserving. Question 5(iii) consequently proves the morphism is a surjection, not an injection. The strict part of a weak order would require an inequality predicate, so the classical equivalence of weak and strict orders on sets does not supply an inverse geometric interpretation.
For the extended theories, interpret the printed final symbols as the classifiers of , respectively; the repeated names in that sentence are a source slip. Let contain finite totally ordered sets and all weak monotone maps, and let contain finite strict total orders and increasing injections. Again include the empty order. Then both linear-order classifiers are presheaf toposes:
For the weak-total model, two finite nondecreasing realized tuples can locally be merged into a single nondecreasing tuple: compare their first remaining entries using totality, take an entry known to be no larger than the other, and continue. This finite procedure uses only finite totality disjunctions and permits duplicate values; it does not require decidable equality. To equalize maps between finite chains, collapse the convex intervals forced equal by their realization; antisymmetry guarantees that all values in such intervals agree. These give the flatness conditions for , and finite tuples recover the model exactly as above.
For a strict-total model, trichotomy merges two finite increasing tuples, identifying entries when the equality alternative holds. Every strict map out of a finite chain is injective: if two indices differ, their images are strictly comparable and cannot be equal. Consequently parallel increasing injections with the same realized tuple are already equal, supplying the equalization condition. The same reconstruction proves the classifying topos of strict linear orders claim; in the weak case it proves the classifying topos of linear orders claim. In particular the latter proof has not silently replaced weak totality by decidable strict trichotomy.
Finally, reflexification sends a strict-total model to a weak-total one. Indeed pulling back weak totality under the interpretation gives
exactly the strict trichotomy axiom. Thus the original morphism restricts to the corresponding subtoposes, giving the commutative square
The vertical embeddings are induced by the full inclusions of finite chains among finite partial orders, and their images classify precisely the added axioms. On presheaves is restriction along . The same object-surjectivity and two-element-collapse argument show that the restricted morphism is also surjective and not an embedding. The exact pullback of the added totality axiom further identifies the square as the corresponding base change of subtoposes.
A proper convex lattice subgroup is prime when and imply or . Equivalently the ordered right cosets of form a totally ordered set. Prime refers to this order property, and does not require a normal subgroup or prime index.
Totally ordered set 2026-10-14
A totally ordered set is a set equipped with a total order. Internally in a topos, weak totality does not imply decidable equality. The empty ordered set is allowed unless an inhabitation axiom is explicitly imposed.