Espartaco

“Is that to say we are against Free Trade? No, we are for Free Trade, because by Free Trade all economical laws, with their most astounding contradictions, will act upon a larger scale, upon the territory of the whole earth; and because from the uniting of all these contradictions in a single group, where they will stand face to face, will result the struggle which will itself eventuate in the emancipation of the proletariat.”

Karl Heinrich Marx · Marx-Engels Collected Works, Vol. VI, p. 290

EnglishEspañol

Tag: invariantes topológicos

  • BITOPOLOGICAL SPACES: LISTENING TO THE DIRECTION OF TIME WHEN IT MATTERS

    BITOPOLOGICAL SPACES: LISTENING TO THE DIRECTION OF TIME WHEN IT MATTERS

    Bitopological Spaces: Listening to the Direction of Time When It Matters

    Bitopological Spaces: Listening to the Direction of Time When It Matters

    How two topologies — built from the same data — can hear the difference between past and future

    Most of the tools we use to analyze sequences of data — averages, correlations, spectral analyses — treat time as a label that could run in either direction without changing the answer. Reverse the order of your data points and many standard methods give you identical results. But in the real world, the direction of time matters profoundly. Economies expand slowly and crash suddenly. Heartbeats rise smoothly and fall steeply. A method blind to direction is a method blind to one of the most fundamental features of how systems change.

    A recent paper by independent researcher José Mauricio Gómez Julián introduces a construction that addresses this gap. Taking a known method from graph theory and extending it to directed graphs, the paper produces a pair of topologies — mathematical frameworks for understanding structure and connectivity — whose divergence is a topological fingerprint of temporal irreversibility. Applied to three decades of American economic data, the method recovers a picture that is both mathematically precise and economically interpretable. Here is a walk through the main ideas.


    Seeing and Being Seen

    The starting point is a beautifully simple idea introduced by Lucas Lacasa and collaborators in 2008. Imagine plotting a time series — say, 129 consecutive quarterly growth rates of U.S. GDP — as points above a timeline. Now connect two points with a line if they can “see” each other: the straight segment between them passes above every intermediate data point, as if you stood at one point and shone a flashlight toward the other with no obstacles in the way.

    The result is a visibility graph: a network whose nodes are time points and whose edges encode a geometric relationship. Visibility graphs have been used to classify chaotic systems, detect heartbeat anomalies, and distinguish between types of economic regimes. They translate the shape of a time series into the structure of a graph, opening the door to the vast toolkit of network science.

    But standard visibility graphs are undirected: an edge between two points does not record which one came first. If you orient each edge from the earlier time point to the later one, you obtain a directed visibility graph — a directed acyclic graph in which the arrows always point forward in time. This orientation carries information about temporal asymmetry that the undirected graph throws away entirely.

    From Networks to Structure

    Here is where the paper’s contribution begins.

    In 2018, Huda Nada and collaborators introduced a procedure for turning any undirected graph into a topological space. For those unfamiliar with the term, a topology is a mathematical framework that defines what it means for groups of points to be “open,” for sets to be “connected,” and for spaces to have “structure.” It operates at a level more abstract than distances or coordinates — it captures the pattern of how sets overlap and separate.

    The Nada construction works as follows. For each vertex of the graph, compute its closed neighborhood: the vertex itself plus all of its immediate neighbors. Take this family of neighborhoods and generate a topology by closing it under two operations: finite intersections (combine neighborhoods by overlapping them) and arbitrary unions (combine neighborhoods by collecting them). The result is a topology on the vertex set, and its invariants — connected components, separation properties, component counts — capture structural features of the graph.

    This procedure is universal: it works for any family of subsets of any set. The mathematical content lies in identifying the right family to use.

    Gómez Julián’s key observation is that for a directed graph, you do not get one family of neighborhoods — you get two. For each vertex:

    The forward closed neighborhood includes the vertex itself and all the vertices it points to — the later time points it can see. The backward closed neighborhood includes the vertex itself and all the vertices that point to it — the earlier time points from which it is visible.

    Apply the Nada procedure to the forward neighborhoods and you get a topology τ+. Apply it to the backward neighborhoods and you get a topology τ. The resulting triple (V, τ+, τ) is what mathematicians call a bitopological space: a set equipped with two topologies simultaneously, a concept introduced by John Kelly in 1963.

    The extension is, in a precise mathematical sense, trivial — the topology axioms do not care where the generating family came from. But recognizing this trivial extension as the right thing to do, and showing that the resulting bitopological structure captures something real about temporal asymmetry, is the paper’s central insight.

    When Two Topologies Disagree

    If the process generating your data is symmetric — equally likely to go up as down, at the same speed — then the forward and backward neighborhoods are statistically exchangeable. The two topologies τ+ and τ look the same, and the bitopological structure adds nothing beyond the undirected construction.

    But if the process is asymmetric, the two topologies diverge. Consider the prototypical asymmetry of economic and physical systems: gradual expansion followed by sudden contraction. Forward visibility through a gradual rise connects many points — each point can see far ahead through the gentle slope. Backward visibility through an abrupt drop connects few — the sharp fall blocks the line of sight. The forward topology ends up more connected (fewer separate components) than the backward topology.

    This divergence is the topological fingerprint of temporal irreversibility. The paper defines three quantitative measures of it:

    The asymmetry direction Δ = C − C+, where C+ and C are the numbers of connected components in the forward and backward topologies. Positive Δ means the forward topology is more connected. The component-count irreversibility index IC, which normalizes the difference to lie between 0 and 1. And the base-size irreversibility index IB, which measures the analogous difference in the sizes of the generating bases.

    These are pure numbers — no calibration, no free parameters, no training data. They emerge from the structure of the data and the construction itself.

    If you reverse the direction of time in your data and the topologies change, something in the process that generated the data is irreversible — and the gap between the two topologies measures exactly how much.

    Peeling the Onion: Three Layers of Structure

    One of the paper’s most clarifying contributions is the identification of three nested layers of topological structure on the same time series, each revealing different information.

    Layer 1 — The Alexandrov topology (reachability). For a directed acyclic graph, the most basic topology treats as “open” any set that is closed under forward reachability: if a node is in the set, all its descendants are too. This topology has exactly one connected component for any weakly connected graph, because every node can reach every later node through some directed path. At this level, the system is globally indecomposable. It tells us what we already know: the economy is a single connected process in which each quarter influences every subsequent quarter through chains of causation.

    Layer 2 — The undirected Nada topology (local fragmentation). When you apply the Nada construction to the undirected shadow of the visibility graph, the topology fragments dramatically. The intersection closure of the neighborhoods reveals clusters of time points that share local structural similarity — groups of observations linked by overlapping visibility neighborhoods — that go beyond mere reachability. This layer uncovers genuine structure that the reachability topology hides entirely.

    Layer 3 — The bitopological layer (temporal asymmetry). When you split the construction into forward and backward, a further distinction emerges. The forward and backward topologies have different component counts — and the difference is invisible to the undirected construction and invisible to the Alexandrov construction. It lives only in the gap between the two directed topologies.

    Each layer is contained within the next: the Alexandrov topology is a subtopology of the Nada topology (a theorem proved in the paper), which in turn underlies the bitopological structure. But each coarser layer hides information that the finer layer reveals.

    What the American Economy Looks Like Through a Topological Lens

    The paper applies the full pipeline to the quarterly growth rate of U.S. real GDP from Q1 1992 to Q1 2024 — 129 observations spanning the dot-com bust, the Global Financial Crisis, and the COVID-19 shock. Two graph constructions are used: the Horizontal Visibility Graph and the Natural Visibility Graph, both in their directed forms.

    The headline finding is that Δ = +4 in both constructions. The forward topology has 4 fewer connected components than the backward topology, regardless of which visibility-graph variant you use. This positive value is consistent with the well-documented asymmetry of the American business cycle over this period: expansions are gradual and sustained (1992–2000, 2001–2007, 2009–2020), while contractions are sharp and short-lived (2001, 2008–2009, 2020). Forward visibility through a gradual expansion is unobstructed; backward visibility through an abrupt contraction is fragmentary.

    What makes this finding compelling is its invariance. The HVG and NVG produce very different graphs — 248 vs. 406 edges, different base sizes, different absolute component counts — yet they agree on the sign and magnitude of Δ. The signal appears robust: a feature of the underlying data, not an artifact of how you choose to draw the graph.

    Another detail worth noting: the base-size irreversibility index IB is exactly zero in both constructions. The forward and backward topologies are generated by bases of equal size (250 and 250 for the HVG, 239 and 239 for the NVG). The asymmetry lives entirely in the structure of those base elements and how their intersections distribute — not in how many there are. The two topologies are built from the same number of building blocks, but those blocks fit together differently depending on whether you are looking forward or backward through time.

    A Single Shock

    Perhaps the most striking empirical finding is what the topology says about the COVID-19 shock.

    The second quarter of 2020 recorded the sharpest contraction in U.S. GDP on record — an annualized rate of roughly −31%. The third quarter recorded the sharpest rebound — roughly +33%. These are the two most extreme observations in the entire 129-quarter series, opposite in sign and opposite in economic interpretation.

    A naive analysis would naturally separate them: one is the worst crash, the other the best recovery. They sit at opposite ends of the value spectrum.

    But the Nada topology classifies them together. Under both the undirected and directed topologies, under both the HVG and NVG, these two observations belong to the same connected component.

    Why? Because the topology is not a proximity measure. It does not group points by how close their values are. It groups them by the structure of their visibility neighborhoods — which other points they can see, and how those visibility patterns intersect. Despite their extreme and opposite values, the two quarters share neighborhoods that overlap substantially. The intersection closure, which drives the Nada construction, puts them in the same cluster.

    This matches the interpretation most economists give to the event: the contraction and the rebound are two phases of a single exogenous shock, driven by the same underlying cause — the pandemic and the policy response to it. The topology recovers this interpretation from the geometry of the data alone, without any economic priors built in.

    What the topology does not claim: it does not say that the two quarters are “similar” in value (they are the two most distant observations in the entire series). It says they are structurally linked — that no topological open set separates them. The construction responds to the combinatorics of visibility, not to the metric of distance.

    Certifying the Construction

    The paper takes reliability seriously at three levels.

    Machine-checked proofs. The central theorem and related core results have been formalized in Lean 4, a proof assistant, against the Mathlib mathematical library. A computer has verified that the proofs are logically correct, with no gaps or hidden assumptions. The formalization is archived alongside the paper as part of a reproducibility bundle on Zenodo.

    Polynomial-time algorithms. Every step of the construction has an explicit algorithm with proven complexity bounds. The connected components of each topology can be computed in polynomial time without enumerating the full topology, which can be exponentially large. The key trick is to work through a combinatorial proxy for the topology called the specialization preorder, using bitset operations that are highly efficient in practice.

    Honest uncertainty. A three-valued decision procedure for pairwise connectedness reports “pairwise connected,” “pairwise disconnected,” or “undecided” — the last when the computation exhausts its resource budget. Rather than guessing, the algorithm honestly reports that it has not finished the work. This is a methodological commitment as much as a technical one: a topological statement counts as established only when the computation has completed the work that establishes it.

    No free parameters. The construction has no tuning knobs. The topological invariants — component counts, base sizes, irreversibility indices — are determined entirely by the data and the definitions. There is nothing to calibrate, nothing to overfit.

    A New Lens

    The paper does not propose to replace existing methods of time series analysis. Correlation, spectral analysis, regime-switching models, and the many other tools of econometrics and statistics capture information that topology cannot see: amplitude, frequency, distributional shape. The paper is explicit about this complementarity.

    What the topological construction offers is a new lens — one that responds to the relational structure of a time series rather than its metric structure. It asks not “how big is this change?” but “what does this change connect to, and what does it disconnect from, and is the answer different depending on which direction in time you are looking?”

    For systems where temporal asymmetry is a defining feature — business cycles, climate dynamics, physiological signals, causal event sequences — this lens may reveal structure that traditional tools, by their very construction, cannot see.

    The application to U.S. GDP is a proof of concept. The construction is general: it applies to any time series that can be turned into a directed visibility graph, which is to say, any time series at all. Whether the invariants it produces are useful features for classification, prediction, or interpretation in broader contexts is an empirical question that the paper opens but does not close.

    What it does establish is this: there exists a construction that takes a time series, produces two topologies from it, and quantifies the gap between them as a measure of temporal irreversibility. The construction is mathematically sound, mechanically verified, algorithmically tractable, parameter-free, and — when applied to the American economy across three turbulent decades — gives answers that make economic sense.

    That is a foundation worth building on.

    “Bitopological Spaces from Directed Graphs: Extending the Nada Construction to Capture Temporal Irreversibility” by José Mauricio Gómez Julián is available at Zenodo (v1.0.2, April 2026). The complete research compendium — Lean 4 formalization, R package, empirical dataset, and reproducibility notebook — is archived alongside it.

  • topologyR: Turning Time Series into Shapes to Test What Your Models Quietly Assume

    topologyR: Turning Time Series into Shapes to Test What Your Models Quietly Assume

    You can also find this library at CRAN and download it directly from R and RStudio.

    There is a habit so embedded in quantitative work that most practitioners never think to question it. You have a time series — quarterly GDP, an EEG channel, a temperature record — and at some point you fit a smooth curve through it, interpolate a missing value, or estimate a “long-run trend.” All of these moves rest on a single, seldom-checked assumption: that the data form one continuous whole, that a single smooth function can legitimately pass through every point.

    But what if they don’t? What if your series is, structurally, two or three disjoint pieces glued together by the calendar — pieces between which no continuous function can travel? In that case, the spline you just fitted is not an approximation of reality; it is a mathematical fiction painted over a fracture.

    topologyR is an R package that lets you check this before you model. It takes a numeric time series, converts it into a graph, converts that graph into a topological space, and then asks the one question that determines whether global continuous methods are even valid: is this space one connected piece, or several?

    It sounds abstract. It is abstract — but the consequence is concrete. The package is the work of José Mauricio Gómez Julián, and it is open-source, with a GitHub repository, a detailed Wiki, and a companion research paper archived on Zenodo. What follows is a tour of what the package does, why it matters, and where it fits in the broader landscape of topological data analysis.


    The Hidden Assumption

    Think about what happens when you impute a missing value in a time series using a cubic spline. The spline assumes that the points on either side of the gap belong to the same continuous process — that the missing value lies somewhere along a smooth bridge between them. If the series has actually undergone a structural break, a regime change, or a discontinuity between those points, the spline will happily produce a number, and that number will be wrong in a way no confidence interval can capture.

    This is not a niche problem. It appears in econometrics (trend estimation across business cycles), in neuroscience (coherence across brain-state transitions), in climatology (warming trends across regime shifts). The methodological error is always the same: assuming continuity without first verifying that continuity is mathematically possible.

    topologyR’s contribution is to make that verification explicit, parameter-free, and exact.


    From Numbers to Shapes: The Pipeline in Three Steps

    The package’s workflow has an elegant, almost architectural logic. You feed it a series of numbers; it returns a topological verdict. Between input and output, three transformations occur.

    Step 1: The Series Becomes a Graph

    The first move is borrowed from network science: the visibility graph. Imagine your time series plotted as a mountain range — each observation is a peak or a valley at a given time. Two points are connected by an edge if you could stand on one and see the other, with no taller peak blocking the line of sight.

    topologyR implements two flavours. The Horizontal Visibility Graph (HVG) connects two points if every point between them is strictly lower than the shorter of the two — a horizontal line of sight. It runs in linear time and captures the skeleton of the series’ ups and downs. The Natural Visibility Graph (NVG) is more generous: it connects two points if every intermediate point lies below the straight line joining them, regardless of the heights of the endpoints. It is denser, richer, and runs in O(n log n) expected time. The NVG always contains the HVG as a subgraph.

    Both are parameter-free. There is no threshold to tune, no bandwidth to select, no ε to agonise over. The graph is determined entirely by the data’s own geometry. This matters enormously: it eliminates the single largest source of arbitrariness in the entire pipeline.

    Step 2: The Graph Becomes a Topology

    Here is where topologyR departs from ordinary network analysis. A graph tells you who is adjacent to whom. A topology tells you something deeper: what the neighbourhood structure of the entire space looks like — which collections of points form coherent open regions, and how those regions combine.

    The construction follows a method introduced by Nada, El Atik, and Atef in 2018. For each vertex v in the graph, you form its closed neighbourhood — the vertex itself plus all its direct neighbours. This family of closed neighbourhoods serves as a subbase. You then close it under finite intersections to obtain a base, and close the base under arbitrary unions to obtain the full topology.

    If those words feel heavy, think of it this way: the subbase is a rough draft of “who belongs with whom.” Intersecting neighbourhoods refines the draft — “the points that both neighbourhoods agree on.” Taking unions completes the picture — “every region that can be assembled from these building blocks.” The result is a genuine topological space, complete with open sets satisfying the standard axioms, sitting on top of your time series like a scaffolding you didn’t know was there.

    Step 3: The Topology Reveals Its Connectivity

    Now comes the decisive question. A topological space is connected if it cannot be split into two non-empty open pieces — if there is no clean fracture running through it. For finite spaces, there is a beautiful theorem, due to McCord (1966) and Stong (1966), that makes this check exact and tractable. The specialization preorder orders the points by how their neighbourhoods nest inside one another, and the connected components of the resulting structure are precisely the topological connected components.

    The crucial practical point: this computation works directly on the base — the refined building blocks — without ever needing to enumerate the full topology (which can be exponentially large). It runs in polynomial time, and the components it returns are exact, not approximate.


    The Decision Rule

    Everything so far converges on a single, actionable verdict. topologyR hands you a connectedness decision, and that decision has a direct methodological consequence:

    • If the induced topology is connected, then your data are consistent with a single continuous process. Global continuous methods — splines, kriging, polynomial interpolation, moving-average imputation, kernel methods — are mathematically supported. You may proceed.
    • If the induced topology is disconnected, then no single continuous function can cover the entire series. Global continuous methods are invalid by construction. You must segment the series along the connected components the package identifies, and model each piece independently — with regime-switching models, component-wise imputation, or finite mixtures.

    This is the package’s value proposition: a reproducible, topology-first workflow that decides, before you touch a model, whether global continuity is a justified assumption or a silent error.

    Global versus Local

    A subtlety worth flagging: the rule depends on what you are trying to learn. Global properties — a secular trend, a Hurst exponent, total neural synchronisation, a centennial warming signal — depend on relationships among all points and require topological connectivity to be valid. Local properties — instantaneous volatility in a small window, point-to-point rates of change, low-order autocorrelation — are defined on restricted neighbourhoods and remain valid within each connected component, regardless of whether the whole series is one piece or several. The package gives you the component structure to make that distinction operational.


    Time Has an Arrow: Directed Topologies and Irreversibility

    So far, the construction has treated the visibility graph as undirected — time flows, but the edges don’t care which way. That discards information. Time series are inherently directional: time runs from past to future, and many real systems are irreversible — they behave differently forwards and backwards. Economic expansions creep upward over years; recessions collapse in quarters. Neurons fire and recover on different timescales. The undirected graph cannot see this asymmetry.

    topologyR’s directed mode fixes this. With directed = TRUE, each visibility edge is oriented from the earlier time point to the later one, producing a directed acyclic graph (a DAG) in which the time index is a natural topological order. From this directed graph, the package extracts two neighbourhood structures: the forward neighbourhood (who can I see ahead of me?) and the backward neighbourhood (who behind me can see me?).

    Applying the Nada construction to each yields two topologies: a forward topology τ⁺ and a backward topology τ⁻. The pair (X, τ⁺, τ⁻) forms what Kelly (1963) called a bitopological space — a set equipped with two topologies rather than one. The divergence between them is a direct, topological measurement of temporal irreversibility.

    Irreversibility Indices

    In a perfectly reversible process — symmetric dynamics, no privileged direction — the two topologies coincide: τ⁺ ≅ τ⁻. They have the same number of connected components, the same base size, the same connectivity. In an irreversible process, they pull apart.

    topologyR quantifies this with several indices. The component irreversibility measures the normalised difference in the number of connected components between the forward and backward topologies: zero means symmetric, one means maximally asymmetric. The base irreversibility does the same for the sizes of the topological bases. The asymmetry direction — the signed difference in component counts — tells you which way the arrow points: a positive value means the forward topology is more connected (fewer components) than the backward one.

    That last point has a concrete physical interpretation. Consider a time series with gradual expansions and abrupt contractions — the classic shape of a business cycle, where GDP creeps up over years and drops in a quarter. During a gradual rise, forward visibility is relatively unobstructed: looking ahead from a point on the upslope, you can see far. After an abrupt drop, backward visibility is blocked: looking back from the trough, the cliff face hides earlier points. This asymmetry means the forward topology should be more connected than the backward topology — fewer forward components, more backward fragmentation. The package predicts, and the data confirm, a positive asymmetry direction for such series.


    The Alexandrov Layer and the Resolution Hierarchy

    There is a third topology lurking in the directed graph, and it is older than the Nada construction by several decades. The Alexandrov topology τ_A, introduced by Alexandrov in 1937, is the topology whose open sets are the upsets of the reachability relation — the sets that, once you enter them, contain everything reachable downstream. For each vertex, its minimal open set is the collection of all vertices reachable from it via directed paths.

    topologyR computes this efficiently: a reverse-order bitset propagation that processes vertices from last to first, OR-ing reachability sets together in O(nm/64) time, reusing the same high-performance bitset infrastructure as the Nada engine.

    The relationship between the Alexandrov and Nada topologies is precise and informative: τ_A is always a subset of the forward Nada topology. The Alexandrov base captures pure order structure — “who can reach whom” — while the Nada intersection closure generates additional sets that are not upsets, catching finer-grained structure. The difference in base sizes, |B_Nada| − |B_A|, tells you exactly how much extra topological information the Nada pipeline extracts beyond the raw ordering. A large gap means the closure operations are doing real work; a small gap means the order structure already tells most of the story.


    Under the Hood: Performance Without Compromise

    Topological enumeration is, in the worst case, exponential — the number of open sets can in principle double with every additional element. This is an inherent mathematical fact, not a software limitation. But topologyR is engineered so that the decision you actually need — connectedness — never requires that enumeration.

    The connectivity computation works on the base alone, via the specialization preorder, in O(n² · ⌈B/64⌉) time. The C++ backend (via Rcpp) represents every subset as a packed array of 64-bit words, so set operations reduce to machine-level bitwise instructions. A compile-time template dispatch selects single-word operations for series up to 64 points, two-word for up to 128, three-word for up to 192 — zero loop overhead, branch-free. Beyond that, a runtime fallback handles arbitrary sample sizes, and OpenMP parallelisation is available where the build supports it.

    The practical upshot: you can run the connectivity decision on series with thousands of points without ever touching the exponential regime. Safety limits (max_base_sets, max_open_sets) cap the intersection and union closures with informative termination flags, so if a computation does hit resource limits, you know exactly where and why — and the connectivity result remains valid as long as the base closure completes.


    A Real-World Test: Reading the Business Cycle

    The paper accompanying the package applies the framework to quarterly U.S. real GDP growth from 1992 to 2024 — 129 observations spanning over three decades. The bitopological analysis recovers a positive asymmetry direction: the forward topology is more connected than the backward one, exactly as predicted for a series with gradual expansions and abrupt contractions.

    The undirected topology partitions the series into six connected components, each corresponding to a distinct macroeconomic regime. Strikingly, the COVID-19 contraction and its rebound — the deepest and fastest swing in the sample — are classified as a single topological episode: one connected component spanning the collapse and recovery, reflecting the fact that the visibility structure treats the V-shaped episode as one structural unit rather than two separate events.

    This is the kind of insight the package is designed to produce: not a forecast, not a parameter estimate, but a structural classification that tells you where the legitimate boundaries in your data lie — and, critically, whether a global model is appropriate at all.


    Where It Sits: Complementary, Not Competing

    It is important to be clear about what topologyR is not. It is not a general-purpose topological data analysis (TDA) engine. Packages like GUDHI, Ripser, TDAstats, and scikit-TDA compute persistent homology — multi-scale features across all dimensions, capturing higher-order structures (loops, voids) via Betti numbers β₁, β₂ and their persistence across scales. That is a richer and harder enterprise.

    topologyR has a narrower and more focused aim: it zeroes in on β₀ — connectedness — for one-dimensional series, using graph-induced topologies, and it turns that single invariant into an actionable decision rule for method selection. Think of it as a pre-model governance tool: a rigorous gatekeeper that runs before you choose your modelling strategy, telling you whether the continuity assumptions your favourite methods require are actually justified by the data’s structure.

    The two approaches are complementary. For early-warning detection, precursor signals, or multi-channel structure, persistent homology is the right tool. For the binary question “can I legitimately fit a global continuous model to this series?”, topologyR gives a direct, interpretable, and mathematically exact answer. A natural hybrid workflow uses topologyR as a pre-test and persistent homology for deeper multi-scale analysis.


    Honest Limitations

    No tool is universal, and topologyR is transparent about its boundaries:

    1. Graph choice matters. HVG and NVG produce different graphs, and therefore potentially different topologies. The NVG, being denser, tends to produce fewer connected components. The package encourages comparing both and interpreting the difference — the gap itself is diagnostic.
    2. Sampling and noise. Sparse sampling can mimic disconnection; minor overlaps can mimic connection. The connectedness verdict should be treated as prima facie evidence, not absolute truth — especially near the boundary.
    3. β₀ only. The approach focuses on connectedness. It will not capture loops, voids, or higher-order patterns that persistent homology can detect. If your question is about cycles or multi-scale structure rather than fragmentation, you need the heavier machinery.
    4. Enumeration is exponential; connectivity is not. This is handled honestly: the connectivity decision is polynomial and scalable; full topology enumeration (needed for pairwise connectedness in the bitopological sense) is capped by safety limits with transparent reporting.

    The Bigger Picture

    What makes topologyR more than a clever technical exercise is its epistemological stance. It transforms a step that is normally a tacit habit — assuming continuity — into an explicit, testable, mathematical procedure. In doing so, it removes arbitrariness from one of the most consequential decisions in applied quantitative work: the choice between global and segmented methods.

    The package’s central theorem — that the Nada construction extends to directed graphs and yields a bitopological space whose asymmetry quantifies irreversibility — is formalised in Lean 4 against Mathlib, so the mathematical foundation is not merely asserted but machine-checked. The implementation is CRAN-compliant, passes R CMD check --as-cran cleanly, and ships with 68 unit tests covering visibility graphs, topology generation, connectivity, directed topology, Alexandrov topology, and bitopological analysis.

    For anyone who works with time series and has ever fitted a spline, run a kriging model, or estimated a trend — which is to say, for most of applied quantitative science — topologyR offers something rare: a way to check, before you model, whether the smoothness you are about to assume is a property of your data or a story you are telling yourself.


    Links and Credits

    The package is authored by José Mauricio Gómez Julián and released under the MIT licence. It requires R ≥ 4.0.0 with Rcpp and ggplot2. The companion paper, “Bitopological Spaces from Directed Graphs: Extending the Nada Construction to Capture Temporal Irreversibility,” develops the full mathematical theory, including the central theorem, the Alexandrov sublayer, specialization preorder, pairwise connectedness, polynomial-time algorithms, and the Lean 4 formalisation.

    If you use topologyR in your research, please cite the repository release.