29 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
24 · 60%
Assisted
5 · 12.5%
Worked by hand
11 · 27.5%
Using the packages
Finite opens, chain matrices and surface invariants give concrete computations. Hypotheses such as compactness, orientability and continuity carry much of the reasoning in this course.
Calculator interface
Place the space, topology and coefficient group above each computation. Offer an editor for simplices and a boundary-matrix view with a check that consecutive boundaries compose to zero.
Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.
Classroom inputs and practical limits
29 of 40 days include a checked executable example. On 10 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.
Ranges across the five units
Days 1–8 · Topological and metric spaces. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
Unit benchmark · geo.countTopologies, labeled points. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms).
Days 9–16 · Continuity and compactness. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
Unit benchmark · analytic.sequence.nFor, decimal tolerance exponent. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16.
Days 17–24 · Paths and homotopy. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
Unit benchmark · complex.winding, positive circuits. Largest passing sample 1,024 (49.38 ms, 89 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 25–32 · Cell complexes and surfaces. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
Unit benchmark · geo.countTopologies, labeled points. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms).
Days 33–40 · Homology. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
Unit benchmark · structures.smithForm, square matrix side. Largest passing sample 50 (7.52 ms, 81.2 MiB peak process RSS). The runs did not locate a ceiling for this family.
Accuracy notes (3)
Fixed · Bisection identifies the root selected by its trace. For (x−1)(x−6)(x−9) on [0,10], the certificate now returns the root 1 inside the last displayed bracket. A sign-changing interval can still contain several roots.
Fixed · The verifier rejects a false tail index. For aₙ=1/(1+(n−50)²) and ε=1/2, changing N to 1 now fails verification. The later term a₅₀=1 proves the modified claim false.
Fixed · Invalid boundary counts are rejected. Euler characteristic 2 with orientability true and −2 boundary circles now raises GeoError. The boundary count must be a nonnegative integer.
How many topologies are there on a three-point set?
Worked solution
Topologies on a finite set correspond to preorders (reflexive, transitive relations), via iff every open set containing contains . On 3 points there are 29.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log([geo.countTopologies(3), geo.countTopologies(3, { t0: true })]);
Checked output
[29, 19]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
For this problem type. Hand enumeration is normally limited to 1–3 labeled points. Four and five points already need substantial bookkeeping.
Focal example. The code above passed its displayed check in 0.477 ms on Node.
Same API, measured input family.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.countTopologies · 1 passing test case, 5 distinct argument descriptions
Implementation limit. The counting algorithm accepts at most five points. Listing all topologies is separately capped at four. Source at the tested revision
Day 02 / 40 · Topological and metric spaces
Metrics
Direct calculation@ratmath/geo
Problem
Describe the unit ball of the taxicab metric in the plane. What is its "" (half the perimeter of the unit circle, measured in the same metric)?
Worked solution
The square with vertices , . Each side has taxicab length 2, so the perimeter is 8 and .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
const m = geo.metric("taxicab");
console.log([String(m.circle([0, 0], 1)), m.pi]);
Checked output
["(1, 0),(0, 1),(-1, 0),(0, -1)", 4]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
Focal example. The code above passed its displayed check in 0.172 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.metric · 2 passing test cases, 2 distinct argument descriptions
is increasing, subadditive and zero only at 0, so the triangle inequality passes from to . Small balls of the two metrics nest inside each other, so the open sets agree.
Using RatMath
The rational triples illustrate the triangle inequality. Prove subadditivity and compare metric balls for all radii near zero.
JavaScript module
import { R } from "@ratmath/core";
// No proof tool. A spot check of the triangle inequality on rationals:
const d = (x, y) => { const a = x.subtract(y).abs(); return a.divide(a.add(R`1`)); };
const xs = ["-3", "-1/2", "0", "2/3", "5"].map((s) => R`${s}`);
console.log(
xs.every((x) => xs.every((y) => xs.every((z) => !d(x, z).greaterThan(d(x, y).add(d(y, z))))))
);
Checked output
true
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
Focal example. The code above passed its displayed check in 2.15 ms on Node.
Related workload in this unit.core.Rational.add · denominator. Baseline test points across courses 1, 2, 3, 12, 100, 1,000. Cross-multiply 1/n + 1/(n+1) against (2n+1)/(n(n+1)).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,007 (0.038 ms, 76.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact work depends on the bit lengths of both numerator and denominator. A long sum of relatively prime fractions can build a large common denominator.
Measured times, memory and outcomes
denominator · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.034
74.9
2
Baseline
Passed
0.036
75.6
3
Baseline
Passed
0.040
75.9
12
Baseline
Passed
0.039
75.2
100
Baseline
Passed
0.041
75
1,000
Baseline
Passed
0.035
75.8
1,000,003
Stretch
Passed
0.044
75
1,000,000,007
Stretch
Passed
0.038
76.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Why do open intervals with rational endpoints form a basis for the usual topology on ℝ?
Worked solution
Given x in an open set, fit an open interval about x inside it, then choose rational endpoints on opposite sides of x inside that interval.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 05 / 40 · Topological and metric spaces
Discrete topology
Direct calculation@ratmath/core
Problem
How many open sets are there on a four-point discrete space?
Worked solution
All subsets are open, so each of four points may independently be included.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`2^4`));
Checked output
16
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
Focal example. The code above passed its displayed check in 0.084 ms on Node.
Same arithmetic expression. Replaced its first numeral 2 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.multiply · operand bits. Baseline test points across courses 8, 32, 64, 256. Cross-multiply the unreduced integer products; operands have unlike denominators.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 131,072 (1.53 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Intermediate products can have twice the bit length of their factors. Repeated squaring can exhaust the engine’s BigInt allocation limit in a small number of steps.
Measured times, memory and outcomes
operand bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
8
Baseline
Passed
0.317
74.6
32
Baseline
Passed
0.035
75.5
64
Baseline
Passed
0.045
75.1
256
Baseline
Passed
0.106
74
1,024
Stretch
Passed
0.035
75.3
8,192
Stretch
Passed
0.075
75.8
32,768
Stretch
Passed
0.245
75
131,072
Stretch
Passed
1.53
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Supply the expression, variable and approach point. At jumps and endpoints the direction of approach matters.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.limit("(1 - cos(x))/x^2", "x", 0).value));
Checked output
1/2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
For this problem type. Use one approach point or infinity, low-degree rational or elementary functions, and both directions when the domain permits.
Focal example. The code above passed its displayed check in 2.58 ms on Node.
Same API, measured input family.symbolic.limit · polynomial degree. Baseline test points across courses 1, 2, 3, 6. For n≥1, (x^n−1)/(x−1) tends to n at x=1.
Practical limit. Largest passing sample 128 (1,021 ms, 91.5 MiB peak process RSS). The first sampled passing call above one second used 128 (1,021 ms). The runs did not locate a ceiling for this family. Cancellation is valid on a punctured neighborhood. Left and right limits and branch choices still require checking in general.
Measured times, memory and outcomes
polynomial degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
9.66
76.6
2
Baseline
Passed
9.66
76.4
3
Baseline
Passed
10.35
77
6
Baseline
Passed
16.39
77.6
12
Stretch
Passed
16.71
78.7
32
Stretch
Passed
44.01
88.5
128
Stretch
Passed
1,021
91.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.limit · 4 passing test cases, 18 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
For this problem type. Classroom tolerances often range from 10⁻¹ to 10⁻⁶. The associated N or δ can be orders of magnitude larger or smaller, depending on the function.
Focal example. The code above passed its displayed check in 9.02 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.deltaFor · 4 passing test cases, 6 distinct argument descriptions
Fixed · The verifier rejects a false tail index. For aₙ=1/(1+(n−50)²) and ε=1/2, changing N to 1 now fails verification. The later term a₅₀=1 proves the modified claim false.
Day 08 / 40 · Topological and metric spaces
Equivalence relations
Direct calculation@ratmath/discrete
Problem
Is an equivalence relation on ? If so, give its classes.
Worked solution
Yes (reflexive, symmetric, transitive): classes and .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as discrete from "@ratmath/discrete";
console.log(discrete.relation([1, 2, 3], [[1, 1], [2, 2], [3, 3], [1, 2], [2, 1]]).classes());
Checked output
[[1, 2], [3]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Finite spaces usually on 1–4 points when listing all topologies; general metric spaces and open-cover definitions are often infinite.
Focal example. The code above passed its displayed check in 0.400 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
discrete.relation · 1 passing test case, 2 distinct argument descriptions
is compact by Heine–Borel. The cover , , of has no finite subcover. For any two distinct rationals choose an irrational strictly between them. Its two open half-lines separate the pair in any rational subspace containing both. Thus every connected subset of the rationals has at most one point.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 10 / 40 · Continuity and compactness
Fixed point theorem
Assisted@ratmath/analytic
Problem
Show every continuous has a fixed point, and find the fixed point of on .
Worked solution
has , so vanishes by the intermediate value theorem. For : .
Using RatMath
The fixed-point iteration finds the cosine example. Apply the intermediate value theorem to f(x)−x to handle every continuous self-map.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.fixedPoint("cos(x)", "1/2").root);
Checked output
0.7390851332151606416[5:6]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
For this problem type. Use one scalar function, one starting point or bracket and about 3–20 displayed iterations. Typical requested errors are 10⁻³ to 10⁻¹⁰.
Focal example. The code above passed its displayed check in 8.34 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.analytic.bisection · decimal tolerance exponent. Baseline test points across courses 2, 4, 6, 8. Both the returned root and its final bracket must contain or agree with √2 to the requested tolerance, allowing one double-precision ulp for the floating trace. Check enclosure endpoint squares.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 24 (7.66 ms, 79.5 MiB peak process RSS). The runs did not locate a ceiling for this family. The displayed iteration trace uses doubles; precision eventually stops improving. A bracket with several roots can select different roots under different starting bounds. Compare the returned enclosure with the trace.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
4.24
74.7
4
Baseline
Passed
4.72
77.2
6
Baseline
Passed
4.12
77
8
Baseline
Passed
6.67
76.9
10
Stretch
Passed
4.27
77.4
12
Stretch
Passed
4.18
75.9
16
Stretch
Passed
4.90
76.4
24
Stretch
Passed
7.66
79.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fixedPoint · 2 passing test cases, 2 distinct argument descriptions
What is the total length of the th stage of the Cantor construction? What is the measure of the Cantor set?
Worked solution
intervals of length : , e.g. at stage 3. The limit is 0, yet the set is uncountable.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as chaos from "@ratmath/chaos";
console.log([chaos.cantor().measure(3), chaos.cantor().stage(2).length]);
Checked output
[8/27, 4]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
For this problem type. Use 2–8 similarity maps or construction depths typically 0–8. Compare dimension estimates with the number and ratios of pieces.
Focal example. The code above passed its displayed check in 0.249 ms on Node.
Same API, measured input family.chaos.cantor.stage · construction depth. Baseline test points across courses 0, 1, 3, 6. At stage n the middle-thirds construction consists of exactly 2^n intervals.
Practical limit. Largest passing sample 18 (2,501 ms, 378.4 MiB peak process RSS). The first sampled passing call above one second used 18 (2,501 ms). The runs did not locate a ceiling for this family. The middle-thirds set has 2ⁿ surviving intervals at stage n. Drawing or retaining every interval therefore consumes exponential space.
Measured times, memory and outcomes
construction depth · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.156
75.4
1
Baseline
Passed
0.374
75.8
3
Baseline
Passed
0.405
76.1
6
Baseline
Passed
10.84
75.8
10
Stretch
Passed
13.82
90.6
14
Stretch
Passed
156
129.1
18
Stretch
Passed
2,501
378.4
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
chaos.cantor · 3 passing test cases, 2 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
For this problem type. Use 2–8 similarity maps or construction depths typically 0–8. Compare dimension estimates with the number and ratios of pieces.
Focal example. The code above passed its displayed check in 0.382 ms on Node.
Same API, measured input family.chaos.attractors.carpet.similarityDimension · requested bits. Baseline test points across courses 8, 16, 24, 40. For eight self-similar pieces of ratio 1/3, dimension d solves 3^d=8. Compare enclosure endpoints to log(8)/log(3) to floating precision.
Practical limit. Largest passing sample 256 (12.53 ms, 79.5 MiB peak process RSS). The runs did not locate a ceiling for this family. The formula assumes the specified contraction ratios and separation hypotheses. Requested bits control the computational accuracy, not validity of those hypotheses.
Measured times, memory and outcomes
requested bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
8
Baseline
Passed
3.64
75.7
16
Baseline
Passed
6.65
76.7
24
Baseline
Passed
3.47
75.9
40
Baseline
Passed
4.70
77.1
64
Stretch
Passed
4.74
77.9
128
Stretch
Passed
14.30
78.2
256
Stretch
Passed
12.53
79.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Day 13 / 40 · Continuity and compactness
Intermediate value theorem
Assisted@ratmath/analytic
Problem
Show has a root in and find it to six decimals.
Worked solution
. Bisection or Newton gives (the plastic number).
Using RatMath
Use continuity and opposite endpoint signs for existence. The numerical root supplies the requested decimal value.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.bisection("x^3 - x - 1", ["1", "2"]).root);
Checked output
1.3247179572447460259[6:7]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
For this problem type. Use one scalar function, one starting point or bracket and about 3–20 displayed iterations. Typical requested errors are 10⁻³ to 10⁻¹⁰.
Focal example. The code above passed its displayed check in 3.00 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.bisection · decimal tolerance exponent. Baseline test points across courses 2, 4, 6, 8. Both the returned root and its final bracket must contain or agree with √2 to the requested tolerance, allowing one double-precision ulp for the floating trace. Check enclosure endpoint squares.
Practical limit. Largest passing sample 24 (7.66 ms, 79.5 MiB peak process RSS). The runs did not locate a ceiling for this family. The displayed iteration trace uses doubles; precision eventually stops improving. A bracket with several roots can select different roots under different starting bounds. Compare the returned enclosure with the trace.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
4.24
74.7
4
Baseline
Passed
4.72
77.2
6
Baseline
Passed
4.12
77
8
Baseline
Passed
6.67
76.9
10
Stretch
Passed
4.27
77.4
12
Stretch
Passed
4.18
75.9
16
Stretch
Passed
4.90
76.4
24
Stretch
Passed
7.66
79.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.bisection · 3 passing test cases, 3 distinct argument descriptions
Fixed · Bisection identifies the root selected by its trace. For (x−1)(x−6)(x−9) on [0,10], the certificate now returns the root 1 inside the last displayed bracket. A sign-changing interval can still contain several roots.
Day 14 / 40 · Continuity and compactness
Product topology
Worked by hand
Problem
Why are arbitrary products given a basis that restricts only finitely many coordinates?
Worked solution
The product topology is generated by coordinate preimages of open sets. Finite intersections of these subbasic sets constrain finitely many coordinates. Requiring infinitely many restrictions generally gives a finer box topology.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 15 / 40 · Continuity and compactness
Continuous image
Worked by hand
Problem
Can a continuous map from [0,1] onto a two-point discrete space exist?
Worked solution
The interval is connected, and its continuous image is connected. The whole two-point discrete space is disconnected.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 16 / 40 · Continuity and compactness
Failure of compactness
Worked by hand
Problem
Give an open cover of (0,1) with no finite subcover.
Worked solution
The intervals (1/n,1) for n≥2 cover (0,1). A finite selection has a largest n and misses points near zero.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Intervals, finite examples and explicit maps. Compactness and continuity statements quantify over points, neighborhoods or covers.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 17 / 40 · Paths and homotopy
Winding numbers
Direct calculation@ratmath/complex
Problem
Find the winding number about 0 of the closed polygon , of the same path traversed twice, and of the triangle .
Worked solution
Once round counter-clockwise: 1. Twice: 2. The triangle does not surround 0: 0.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
const W = complex.winding;
console.log(
[W(["1", "i", "-1", "-i", "1"]), W(["1", "i", "-1", "-i", "1", "i", "-1", "-i", "1"]), W(["3", "3+i", "2+i", "3"])]
);
Checked output
[1, 2, 0]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
Focal example. The code above passed its displayed check in 0.409 ms on Node.
Same API, measured input family.complex.winding · positive circuits. Baseline test points across courses 1, 2, 4, 8. A counterclockwise diamond traversed n times has winding n about the origin.
Practical limit. Largest passing sample 1,024 (49.38 ms, 89 MiB peak process RSS). The runs did not locate a ceiling for this family. Cost grows with path segments. A contour meeting the target point has undefined winding. Verify clearance and orientation before interpreting a count.
Measured times, memory and outcomes
positive circuits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.19
75.2
2
Baseline
Passed
1.60
74.7
4
Baseline
Passed
1.16
75.6
8
Baseline
Passed
1.49
75.1
32
Stretch
Passed
2.59
76
128
Stretch
Passed
7.50
78.1
1,024
Stretch
Passed
49.38
89
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.winding · 1 passing test case, 5 distinct argument descriptions
What is the degree of on the unit circle (how many times does the image wind round 0)?
Worked solution
winds three times: degree 3, equal to the number of zeros inside (argument principle).
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(complex.argumentPrinciple("z^3", complex.Contour.circle(0, 1)));
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 116 ms on Node.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.argumentPrinciple · 3 passing test cases, 3 distinct argument descriptions
What are the fundamental groups of the circle, the torus and ?
Worked solution
, , .
Using RatMath
Identify the group presented by each output: one free generator, two commuting free generators, or one generator with square one.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(
[geo.simplicial.sphere(1), geo.surface("a b a^-1 b^-1"), geo.surface("a a")].map((X) => String(X.fundamentalGroup()))
);
Checked output
["⟨e3 | ⟩", "⟨a, b | aba⁻¹b⁻¹⟩", "⟨a | a²⟩"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 2.31 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.simplicial.sphere · 2 passing test cases, 4 distinct argument descriptions
Under stereographic projection from the north pole of the unit sphere, where does the point go?
Worked solution
. The sphere minus a point is homeomorphic to the plane.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(String(geo.spoint("3/5", 0, "4/5").stereographic));
Checked output
(3, 0)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
Focal example. The code above passed its displayed check in 0.190 ms on Node.
Related workload in this unit.complex.winding · positive circuits. Baseline test points across courses 1, 2, 4, 8. A counterclockwise diamond traversed n times has winding n about the origin.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,024 (49.38 ms, 89 MiB peak process RSS). The runs did not locate a ceiling for this family. Cost grows with path segments. A contour meeting the target point has undefined winding. Verify clearance and orientation before interpreting a count.
Measured times, memory and outcomes
positive circuits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.19
75.2
2
Baseline
Passed
1.60
74.7
4
Baseline
Passed
1.16
75.6
8
Baseline
Passed
1.49
75.1
32
Stretch
Passed
2.59
76
128
Stretch
Passed
7.50
78.1
1,024
Stretch
Passed
49.38
89
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.spoint · 2 passing test cases, 2 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.contourIntegral("1/z", complex.Contour.circle(0, 1))));
Checked output
0 + 6.2831853072i ± 7.9e-17
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 78.50 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.contourIntegral · 6 passing test cases, 7 distinct argument descriptions
Why is the quotient [0,1] with its two endpoints identified homeomorphic to the circle?
Worked solution
The map t↦exp(2πit) is continuous and identifies exactly the endpoints. The induced continuous bijection from the compact quotient to the Hausdorff circle is a homeomorphism.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 23 / 40 · Paths and homotopy
Contractibility
Worked by hand
Problem
Give a contraction of ℝ² to the origin.
Worked solution
H(x,t)=(1−t)x is continuous, starts at x and ends at zero.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 24 / 40 · Paths and homotopy
Product loops
Worked by hand
Problem
What is the fundamental group of the torus, and what do its coordinates count?
Worked solution
The two circle projections give independent winding numbers. Their pair identifies the group with ℤ×ℤ.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Low-degree circle maps, simple polygonal loops and familiar spaces such as the circle, sphere and torus.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 25 / 40 · Cell complexes and surfaces
Euler characteristic of polyhedra
Direct calculation@ratmath/geo
Problem
Compute for the tetrahedron, cube and icosahedron.
Worked solution
, , : all 2, the Euler characteristic of the sphere.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(["tetrahedron", "cube", "icosahedron"].map((n) => geo.solids[n]().euler));
Checked output
[2, 2, 2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 105 ms on Node.
Same API, measured input family.geo.solids · number of catalog solids checked. Baseline test points across courses 1, 2, 3, 5. Compare the vertex, edge and face counts with the known convex polyhedra and verify V−E+F=2 for each.
Practical limit. Largest passing sample 9 (939 ms, 99.7 MiB peak process RSS). The first sampled passing call above 100 ms used 5 (444 ms). The runs did not locate a ceiling for this family. These inputs select named solids from a finite catalog. Mesh processing for an arbitrary number of faces would be a different operation.
Measured times, memory and outcomes
number of catalog solids checked · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.23
75.4
2
Baseline
Passed
3.73
75.8
3
Baseline
Passed
3.42
76.6
5
Baseline
Passed
444
94.9
7
Stretch
Passed
437
95.5
9
Stretch
Passed
939
99.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Day 26 / 40 · Cell complexes and surfaces
Euler characteristic of a graph
Direct calculation@ratmath/discrete · @ratmath/geo
Problem
For the Petersen graph as a 1-dimensional complex, find and the rank of .
Worked solution
. It is connected, so and independent cycles.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as discrete from "@ratmath/discrete";
import * as geo from "@ratmath/geo";
const P = geo.simplicial.fromGraph(discrete.petersen());
console.log([P.eulerCharacteristic, P.betti()[1]]);
Checked output
[-5, 6]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
For this problem type. Use 3–20 labeled vertices and a stated edge list. For a walk count also supply length, usually a single digit in a hand problem.
Focal example. The code above passed its displayed check in 2.26 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.simplicial.fromGraph · 1 passing test case, 1 distinct argument description
A closed orientable surface has a triangulation with 10 vertices, 36 edges and 24 triangles. Check that these counts are possible, and say which surface it is.
Worked solution
In a closed triangulated surface every triangle has 3 edges and every edge lies on exactly 2 triangles, so : . Then : genus 2, the double torus. (This is the f-vector of a minimal genus-2 triangulation.)
Using RatMath
Check 3F=2E, then use connectedness, closedness and orientability to infer the genus. Incidence balance alone does not construct a triangulation.
JavaScript module
import * as geo from "@ratmath/geo";
const [V, E, F] = [10, 36, 24];
const s = geo.classifySurface({ euler: V - E + F, orientable: true });
console.log([3 * F === 2 * E, s.eulerCharacteristic, s.genus]);
Checked output
[true, -2, 2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 0.212 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.classifySurface · 1 passing test case, 4 distinct argument descriptions
Fixed · Invalid boundary counts are rejected. Euler characteristic 2 with orientability true and −2 boundary circles now raises GeoError. The boundary count must be a nonnegative integer.
Day 28 / 40 · Cell complexes and surfaces
Genus of a graph
Direct calculation@ratmath/discrete
Problem
What is the genus of (the least genus of a surface it embeds in)?
Worked solution
It is not planar, and it embeds in the torus: genus 1. (.)
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as discrete from "@ratmath/discrete";
const t = discrete.genus(discrete.complete(5));
console.log(
[discrete.isPlanar(discrete.complete(5)), t.genus, t.proven, discrete.embeddingGenus(discrete.complete(5), t.blocks[0].rotation).faces.length]
);
Checked output
[false, 1, true, 5]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
For this problem type. Use 3–20 labeled vertices and a stated edge list. For a walk count also supply length, usually a single digit in a hand problem.
Focal example. The code above passed its displayed check in 2.96 ms on Node.
Related workload in this unit.discrete.isBipartite · cycle vertices. Baseline test points across courses 3, 4, 5, 12, 30. A cycle has a bipartition precisely when its length is even.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (21.70 ms, 92.2 MiB peak process RSS). The runs did not locate a ceiling for this family. Graph traversal depends on vertices and edges. A long sparse cycle has far fewer edges than a dense graph of the same order.
Measured times, memory and outcomes
cycle vertices · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
3
Baseline
Passed
0.252
75.7
4
Baseline
Passed
0.382
74.8
5
Baseline
Passed
0.406
75
12
Baseline
Passed
0.424
74.9
30
Baseline
Passed
0.349
75.7
100
Stretch
Passed
0.609
75.9
1,000
Stretch
Passed
20.72
77.9
10,000
Stretch
Passed
21.70
92.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
discrete.genus · 5 passing test cases, 1 distinct argument description
Möbius and Császár's minimal triangulation of the torus has 7 vertices, 21 edges and 14 triangles. Check its Euler characteristic.
Worked solution
, as it must be for a torus. (Every pair of the 7 vertices is an edge: .)
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
const T = geo.simplicial.torus();
console.log([T.fVector, T.eulerCharacteristic, String(T.homology(1)), T.classify().name]);
Checked output
[[7, 21, 14], 0, "Z^2", "torus"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 5.78 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.simplicial.torus · 2 passing test cases, 1 distinct argument description
20 triangular faces, , five faces at each vertex so . .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
const P = geo.solids.icosahedron();
console.log([P.V, P.E, P.F, P.euler]);
Checked output
[12, 30, 20, 2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
For this problem type. This example selects a built-in theorem or solid. The input is a discrete choice from a finite catalog. The displayed call has no freely scalable numeric argument.
Focal example. The code above passed its displayed check in 144 ms on Node.
Same API, measured input family.geo.solids · number of catalog solids checked. Baseline test points across courses 1, 2, 3, 5. Compare the vertex, edge and face counts with the known convex polyhedra and verify V−E+F=2 for each.
Practical limit. Largest passing sample 9 (939 ms, 99.7 MiB peak process RSS). The first sampled passing call above 100 ms used 5 (444 ms). The runs did not locate a ceiling for this family. These inputs select named solids from a finite catalog. Mesh processing for an arbitrary number of faces would be a different operation.
Measured times, memory and outcomes
number of catalog solids checked · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.23
75.4
2
Baseline
Passed
3.73
75.8
3
Baseline
Passed
3.42
76.6
5
Baseline
Passed
444
94.9
7
Stretch
Passed
437
95.5
9
Stretch
Passed
939
99.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.solids.icosahedron · 2 passing test cases, 1 distinct argument description
How can one detect the effect of a trip around the core of a Möbius band?
Worked solution
Transport a local orientation around once. The gluing reverses it, so it cannot extend to a global orientation.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 32 / 40 · Cell complexes and surfaces
Connected sum
Direct calculation@ratmath/core
Problem
Find χ for the connected sum of two tori.
Worked solution
Removing a disc from each torus lowers each characteristic by one. Gluing along circles adds no further contribution.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`0+0-2`));
Checked output
-2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Small cell decompositions or surface polygons and low genera; require valid incidences before classifying a surface.
Focal example. The code above passed its displayed check in 0.104 ms on Node.
Same arithmetic expression. Replaced its first numeral 0 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
The torus has a cell structure with one 0-cell, two 1-cells and one 2-cell attached along . Find .
Worked solution
and , so .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(String(geo.surface("a b a^-1 b^-1").homology(1)));
Checked output
Z^2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 0.405 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.surface · 5 passing test cases, 9 distinct argument descriptions
has one cell in each dimension 0, 1, 2, the 2-cell attached along . Find .
Worked solution
, : .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(String(geo.surface("a a").homology(1)));
Checked output
Z/2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 0.146 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.surface · 5 passing test cases, 9 distinct argument descriptions
The Klein bottle is one 0-cell, 1-cells , and a 2-cell attached along . Find .
Worked solution
: .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
console.log(String(geo.surface("a b a^-1 b").homology(1)));
Checked output
Z/2 × Z
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
For this problem type. Use a low-genus surface or a small complex with a few to tens of faces. Face identifications and valid boundary data matter as much as counts.
Focal example. The code above passed its displayed check in 0.122 ms on Node.
Related workload in this unit.geo.countTopologies · labeled points. Baseline test points across courses 1, 2, 3, 4. Compare the counts of labeled topologies with 1,4,29,355,6942,209527.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 5 (941 ms, 88.6 MiB peak process RSS). Library refusal at 6. The first sampled passing call above 100 ms used 5 (941 ms). The number of labeled topologies grows rapidly. An explicit census on a finite set is much harder than checking a given topology.
Measured times, memory and outcomes
labeled points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.172
75
2
Baseline
Passed
0.209
75.4
3
Baseline
Passed
0.298
76.1
4
Baseline
Passed
18.86
77.3
5
Stretch
Passed
941
88.6
6
Stretch
Library refusal · GeoError: counting by preorders is limited to n ≤ 5 here (6 points have 209527 topologies)
0.170
75.6
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
geo.surface · 5 passing test cases, 9 distinct argument descriptions
A cell complex has (in bases of 2-cells and 1-cells) and . Find .
Worked solution
The Smith form of is (gcd of entries 2, ). .
Using RatMath
Enter the integer matrix with its original row and column bases. Read the diagonal invariant factors together with any free summands.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(
[structures.smithForm([[2, 4], [6, 8]]).diagonal, String(structures.integerModule([[2, 4], [6, 8]], 2))]
);
Checked output
[[2n, 4n], "Z/2 × Z/4"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
For this problem type. Hand examples use roughly 2–6 rows and columns over the integers. Keep entries small and specify the coefficient ring.
Focal example. The code above passed its displayed check in 0.289 ms on Node.
Same API, measured input family.structures.smithForm · square matrix side. Baseline test points across courses 1, 2, 3, 5. For a diagonal matrix with 1,2,4,… each invariant factor already divides the next.
Practical limit. Largest passing sample 50 (7.52 ms, 81.2 MiB peak process RSS). The runs did not locate a ceiling for this family. Diagonal input is favorable. Dense integer matrices can create large intermediate coefficients even when their final invariant factors are small.
Measured times, memory and outcomes
square matrix side · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.310
74.3
2
Baseline
Passed
0.448
75.9
3
Baseline
Passed
0.400
75.2
5
Baseline
Passed
0.423
74.8
10
Stretch
Passed
0.565
75.5
25
Stretch
Passed
2.55
76.1
50
Stretch
Passed
7.52
81.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.smithForm · 1 passing test case, 6 distinct argument descriptions
Find the Smith normal form of and the abelian group modulo its columns.
Worked solution
of entries ; of minors ; . So and the cokernel is .
Using RatMath
Enter the integer matrix with its original row and column bases. Read the diagonal invariant factors together with any free summands.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(structures.smithForm([[2, 4, 4], [-6, 6, 12], [10, -4, -16]]).diagonal);
Checked output
[2n, 6n, 12n]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
For this problem type. Hand examples use roughly 2–6 rows and columns over the integers. Keep entries small and specify the coefficient ring.
Focal example. The code above passed its displayed check in 0.724 ms on Node.
Same API, measured input family.structures.smithForm · square matrix side. Baseline test points across courses 1, 2, 3, 5. For a diagonal matrix with 1,2,4,… each invariant factor already divides the next.
Practical limit. Largest passing sample 50 (7.52 ms, 81.2 MiB peak process RSS). The runs did not locate a ceiling for this family. Diagonal input is favorable. Dense integer matrices can create large intermediate coefficients even when their final invariant factors are small.
Measured times, memory and outcomes
square matrix side · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.310
74.3
2
Baseline
Passed
0.448
75.9
3
Baseline
Passed
0.400
75.2
5
Baseline
Passed
0.423
74.8
10
Stretch
Passed
0.565
75.5
25
Stretch
Passed
2.55
76.1
50
Stretch
Passed
7.52
81.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.smithForm · 1 passing test case, 6 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as linalg from "@ratmath/linalg";
console.log(linalg.nullspace([[1, 2, 3], [2, 4, 6]]).exact());
Checked output
[[[-2], [1], [0]], [[-3], [0], [1]]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
For this problem type. Hand calculations usually use 2–5 rows and columns with small integer or rational entries. Include deficient rank as a separate case.
Focal example. The code above passed its displayed check in 0.627 ms on Node.
Related workload in this unit.linalg.rref.exact · matrix side. Baseline test points across courses 1, 2, 4, 8. A lower triangular square matrix with diagonal 1 is invertible and reduces to the identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (119 ms, 92.8 MiB peak process RSS). The first sampled passing call above 100 ms used 128 (119 ms). The runs did not locate a ceiling for this family. Exact elimination preserves pivots. Input dimensions, rank and the size of intermediate fractions affect memory and time.
Measured times, memory and outcomes
matrix side · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.937
76.1
2
Baseline
Passed
0.800
75.3
4
Baseline
Passed
1.05
75.4
8
Baseline
Passed
2.45
74.4
16
Stretch
Passed
3.07
75.6
32
Stretch
Passed
8.82
78.7
64
Stretch
Passed
19.67
89.3
128
Stretch
Passed
119
92.8
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
linalg.nullspace · 1 passing test case, 1 distinct argument description
Why does the boundary of an oriented triangle have zero boundary?
Worked solution
Each vertex appears twice with opposite signs among the three oriented edges. The coefficients cancel.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 40 / 40 · Homology
Coefficient dependence
Worked by hand
Problem
A cellular boundary is multiplication by 2 from degree 2 to degree 1 with zero next boundary. What is H₁ over ℤ and over ℚ?
Worked solution
Over ℤ the cokernel is ℤ/2ℤ. Over ℚ multiplication by 2 is surjective, so the cokernel is zero.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Boundary matrices commonly have a few to tens of rows or columns; the coefficient ring and orientability affect homology.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.