File size: 10,402 Bytes
06e4298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# Mathematical Dependency Graphs β€” Design Document

## Overview

A hybrid architecture for representing and visualizing axiomatic dependency structures across multiple mathematical subjects. Supports both static Mermaid subgraphs and interactive full-graph exploration.

---

## Scope: Target Subjects

| Subject | Foundations | Derived Items | Notes |
|---------|-------------|---------------|-------|
| **Euclid's Elements** | Postulates, Common Notions, Definitions | 464 Propositions (13 books) | Geometric constructions |
| **Peano Arithmetic** | 5 axioms, definitions | Theorems | Successor, induction |
| **Other number systems** | Axioms (integers, rationals, reals) | Theorems | Construction sequences |
| **Number theory** | Definitions, lemmas | Theorems | Divisibility, primes |
| **Algebra** | Group/ring/field axioms | Theorems | Abstract structures |
| **Contemporary geometry** | Modern axiom systems | Theorems | Metric, affine |
| **Hilbert's geometry** | 5 groups of axioms (incidence, order, congruence, etc.) | Theorems | *Grundlagen der Geometrie* |
| **Tarski's geometry** | Betweenness, congruence relations | Theorems | First-order, decidable |
| **Analysis** | Completeness, continuity axioms | Theorems | Real analysis, limits |

---

## Core JSON Schema

### Discourse (per subject)

```json
{
  "schemaVersion": "1.0",
  "discourse": {
    "id": "euclid-elements",
    "name": "Euclid's Elements",
    "subject": "geometry",
    "variant": "classical",
    "description": "The thirteen books of Euclidean geometry",
    "structure": {
      "books": 13,
      "chapters": "varies",
      "foundationTypes": ["postulate", "commonNotion", "definition"]
    }
  },
  "metadata": {
    "created": "2026-03-15",
    "lastUpdated": "2026-03-15",
    "version": "1.0.0",
    "license": "CC BY 4.0",
    "authors": ["Welz, G."],
    "methodology": "Programming Framework",
    "citation": "Welz, G. (2026). Euclid's Elements Dependency Graph. Programming Framework."
  },
  "sources": [
    {
      "id": "euclid-heath",
      "type": "primary",
      "authors": "Heath, T.L.",
      "title": "The Thirteen Books of Euclid's Elements",
      "year": "1908",
      "edition": "2nd",
      "publisher": "Cambridge University Press",
      "url": "https://archive.org/details/euclidheath00heatiala",
      "notes": "Standard English translation with commentary"
    },
    {
      "id": "perseus",
      "type": "digital",
      "title": "Euclid, Elements",
      "url": "http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.01.0086",
      "notes": "Perseus Digital Library, Greek text with English"
    }
  ],
  "nodes": [
    {
      "id": "P1",
      "type": "postulate",
      "label": "Draw a straight line between two points",
      "shortLabel": "Post. 1",
      "book": 1,
      "number": 1,
      "colorClass": "postulate",
      "sourceRef": "euclid-heath, Book I, Postulate 1",
      "notes": "Also: Postulate 1 in most editions"
    },
    {
      "id": "Prop1",
      "type": "proposition",
      "label": "Construct an equilateral triangle on a given line",
      "shortLabel": "Prop. I.1",
      "book": 1,
      "number": 1,
      "colorClass": "proposition",
      "sourceRef": "euclid-heath, Book I, Proposition 1",
      "notes": "First proposition; depends only on P1, P3"
    }
  ],
  "edges": [
    {"from": "P1", "to": "Prop1"},
    {"from": "P3", "to": "Prop1"}
  ],
  "colorScheme": {
    "postulate": {"fill": "#e74c3c", "stroke": "#c0392b"},
    "commonNotion": {"fill": "#9b59b6", "stroke": "#8e44ad"},
    "proposition": {"fill": "#1abc9c", "stroke": "#16a085"},
    "definition": {"fill": "#3498db", "stroke": "#2980b9"},
    "theorem": {"fill": "#1abc9c", "stroke": "#16a085"}
  }
}
```

### Node Types (extensible)

| Type | Use Case |
|------|----------|
| `axiom` | Peano, Hilbert, Tarski |
| `postulate` | Euclid |
| `commonNotion` | Euclid |
| `definition` | All subjects |
| `proposition` | Euclid |
| `theorem` | Most subjects |
| `lemma` | Supporting results |
| `corollary` | Direct consequences |

### Cross-Discourse Links (future)

```json
{
  "from": "Prop_I_47",
  "to": "peano-theorem-42",
  "discourseFrom": "euclid-elements",
  "discourseTo": "peano-arithmetic",
  "relation": "constructive_correspondence"
}
```

---

## Hybrid Architecture

### 1. Canonical JSON (Source of Truth)

- One JSON file per discourse: `euclid-elements.json`, `peano-arithmetic.json`, etc.
- Stored in GCS or repo
- Human-editable, version-controlled
- Can be validated against schema

### 2. Mermaid Subgraph Generator

- **Input:** JSON + filter (e.g., `book=1`, `props=1-15`)
- **Output:** Mermaid `graph TD` string
- **Use:** Static HTML pages, PDF export, small-scope viewing
- **Limit:** ~50–80 nodes per diagram for readability

**Filter options:**
- `book`, `chapter`, `numberRange`
- `depth`: dependencies only, dependents only, or both
- `focus`: node ID + N-hop neighborhood

### 3. Interactive Viewer

- **Input:** Full JSON (or lazy-loaded by book)
- **Tech:** Cytoscape.js, vis.js, or Sigma.js
- **Features:**
  - Zoom, pan, minimap
  - Search by ID or label
  - Click node β†’ highlight upstream/downstream
  - Filter by type, book, chapter
  - Cluster by book/chapter
  - Export subgraph as Mermaid
- **Deployment:** Single HTML + JS, fetches JSON from GCS

### 4. Index / Registry

```json
{
  "schemaVersion": "1.0",
  "lastUpdated": "2026-03-15",
  "discourses": [
    {
      "id": "euclid-elements",
      "name": "Euclid's Elements",
      "url": "https://.../euclid-elements.json",
      "nodeCount": 480,
      "edgeCount": 1200,
      "subjects": ["geometry"],
      "keywords": ["Euclid", "Elements", "plane geometry", "constructions"],
      "sources": [
        {"id": "euclid-heath", "authors": "Heath, T.L.", "title": "The Thirteen Books of Euclid's Elements", "year": "1908"}
      ],
      "metadata": {"version": "1.0.0", "lastUpdated": "2026-03-15"}
    },
    {
      "id": "peano-arithmetic",
      "name": "Peano Arithmetic",
      "url": "https://.../peano-arithmetic.json",
      "nodeCount": 85,
      "edgeCount": 120,
      "subjects": ["arithmetic", "foundations"],
      "keywords": ["Peano", "axioms", "induction", "successor"],
      "sources": [
        {"id": "peano-1889", "authors": "Peano, G.", "title": "Arithmetices principia", "year": "1889"}
      ],
      "metadata": {"version": "1.0.0", "lastUpdated": "2026-03-15"}
    }
  ]
}
```

---

## File Structure (Proposed)

```
mathematics-dependency-graphs/
β”œβ”€β”€ schema/
β”‚   └── discourse-schema.json          # JSON Schema for validation
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ index.json                     # Registry of all discourses
β”‚   β”œβ”€β”€ euclid-elements.json
β”‚   β”œβ”€β”€ peano-arithmetic.json
β”‚   β”œβ”€β”€ hilbert-geometry.json
β”‚   └── tarski-geometry.json
β”œβ”€β”€ generator/
β”‚   └── mermaid-from-json.js           # Subgraph β†’ Mermaid
β”œβ”€β”€ viewer/
β”‚   β”œβ”€β”€ interactive-viewer.html        # Full interactive graph
β”‚   └── viewer.js
└── static/                            # Pre-generated Mermaid pages
    β”œβ”€β”€ euclid/
    β”‚   β”œβ”€β”€ book1-props-1-15.html
    β”‚   β”œβ”€β”€ book1-props-16-30.html
    β”‚   └── ...
    └── peano/
        └── ...
```

---

## Integration with Existing Systems

- **Mathematics Processes Database (GCS):** Static Mermaid pages can live in `processes/geometry_topology/` or a new `dependency-graphs/` folder
- **Programming Framework:** Same 5/6-color scheme; extend with subject-specific palettes (e.g., Tarski uses relation types)
- **GLMP-style collections:** Each discourse is a "collection"; index.json is the catalog

---

## Implementation Phases

| Phase | Deliverable |
|-------|-------------|
| **1** | Schema + Euclid Props 1–6 JSON; Mermaid generator script |
| **2** | Euclid Book I full JSON; static pages for Books I–IV |
| **3** | Interactive viewer (single discourse) |
| **4** | Peano Arithmetic, Hilbert Geometry JSON |
| **5** | Multi-discourse index; cross-discourse navigation |
| **6** | Tarski, Analysis, other subjects |

---

## Color Scheme Consistency

Use GLMP 6-color for *process* flowcharts (algorithms). For *dependency* graphs, allow subject-specific schemes:

- **Euclid:** Postulates (red), Common Notions (purple), Propositions (teal)
- **Peano:** Axioms (red), Definitions (yellow), Theorems (teal)
- **Hilbert:** Axiom groups (distinct colors), Theorems (teal)
- **Tarski:** Primitive relations (red), Defined relations (blue), Theorems (teal)

Schema supports `colorScheme` per discourse.

---

## Metadata & Sources

### Discourse-Level Metadata

| Field | Purpose |
|-------|---------|
| `metadata.created` | ISO date of initial creation |
| `metadata.lastUpdated` | ISO date of last edit |
| `metadata.version` | Semantic version (e.g., 1.0.0) |
| `metadata.license` | License (e.g., CC BY 4.0) |
| `metadata.authors` | Contributors to the dependency graph |
| `metadata.methodology` | e.g., Programming Framework |
| `metadata.citation` | How to cite this graph |

### Discourse-Level Sources

| Field | Purpose |
|-------|---------|
| `sources[].id` | Reference ID for node-level `sourceRef` |
| `sources[].type` | `primary`, `secondary`, `digital`, `commentary` |
| `sources[].authors` | Author(s) |
| `sources[].title` | Title of work |
| `sources[].year` | Publication year |
| `sources[].url` | Link to digital copy |
| `sources[].doi` | DOI if available |
| `sources[].notes` | Clarifications |

### Node-Level Metadata

| Field | Purpose |
|-------|---------|
| `sourceRef` | Reference to `sources[].id` + location (e.g., "euclid-heath, Book I, Prop 1") |
| `notes` | Editorial notes, variants, clarifications |
| `keywords` | Tags for search/filter |
| `relatedNodes` | IDs of conceptually related nodes (same discourse or cross-discourse) |

### Index / Registry Metadata

The index should include per-discourse: `sources`, `metadata`, `lastUpdated`, `nodeCount`, `edgeCount`, `subjects`, `keywords`.

---

## References

- Euclid's Elements: [Perseus Digital Library](http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.01.0086)
- Heath, T.L. *The Thirteen Books of Euclid's Elements* (1908, 2nd ed.)
- Hilbert: *Grundlagen der Geometrie* (1899)
- Tarski: *What is Elementary Geometry?* (1959)
- Peano: *Arithmetices principia* (1889)