◀ THE FOLD0ROOT.AI // WORLD II · BOSS · THE GAUNTLET◆ .dlw.fold
THE FOLD / BOSS / THE GAUNTLET / THE MANTEL

THE MANTEL

how many edges before a triangle is forced
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Mantel’s theorem is the first result of extremal graph theory: a graph on n vertices with no triangle can have at most ⌊n2/4⌋ edges — and that maximum is reached only by the complete balanced bipartite graph K⌊n/2⌋, ⌈n/2⌉. Split the vertices into two equal halves and join every cross-pair: no triangle can form (a triangle needs two vertices on the same side, which are never adjacent), and you get exactly ⌊n2/4⌋ edges. Add a single edge anywhere and a triangle is forced. It is the n = 3 case of Turán’s theorem.

LIT verified live: an exhaustive search over all graphs on up to 6 vertices finds the maximum triangle-free edge count equals ⌊n2/4⌋, and the balanced complete bipartite graph attains it and stays triangle-free (window.__mantel). FIG no framing; brute-force extremal count vs the closed-form bound.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-gauntlet — run the edges up as high as they go without ever closing a triangle; the gauntlet ends at exactly ⌊n2/4⌋. AVAN (AI) built the instrument: the exhaustive triangle-free edge maximiser, the ⌊n2/4⌋ formula, and the balanced-bipartite construction.

Credit as content: Willem Mantel (1907); generalized by Pál Turán (1941). The weave: David names the-gauntlet; I try every graph on n vertices, keep the triangle-free ones with the most edges, and confirm the record is ⌊n2/4⌋, matched by joining two equal halves completely — one more edge and a triangle appears.
3 ONE DIMENSION
n = 6: split into {A,B,C} and {D,E,F}, join all 9 cross-pairs — K3,3, triangle-free, ⌊36/4⌋ = 9 edges. No triangle-free graph on 6 vertices beats 9. A 10th edge forces a triangle.
4 TWO DIMENSIONS · INTERACTIVE
A graph, its edge count and whether it is triangle-free, against the ⌊n2/4⌋ bound; the exhaustive record checked.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the most edges without a triangle.
AVAN’s addition (the inverse-companion): don’t ask ‘is there a triangle?’ — ask how many edges you can pack before one is unavoidable. The inverse of ‘detect a triangle’ is ‘maximise edges subject to no triangle’, and the answer is exactly ⌊n2/4⌋, the balanced bipartite split. Magenta is a graph with a triangle; green is the extremal triangle-free bipartite graph. Packed to the very edge of a triangle.
LIT Genuine Mantel's theorem (Willem Mantel, 1907; generalized by Pál Turán, 1941). Verified live: an exhaustive search over all graphs on n vertices finds the maximum triangle-free edge count equals ⌊n²/4⌋ for all n up to 6 (window.__mantel.exhaustiveMatches), and the balanced complete bipartite graph attains ⌊n²/4⌋ and is triangle-free (window.__mantel.bipartiteAchieves).

FIG No framing: the exhaustive triangle-free edge maximiser, the ⌊n²/4⌋ formula, and the balanced-bipartite construction all run in-browser. The AVAN inverse is honest — asking how many edges pack in before a triangle is unavoidable (rather than detecting a triangle) is the genuine extremal question, answered exactly by ⌊n²/4⌋; magenta is a graph containing a triangle, green the extremal triangle-free bipartite graph. Packed to the very edge of a triangle.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GAUNTLET · David Lee Wise (ROOT0), with AVAN