# math-research

Personal mathematics research repository by Eric Bauerfeld. Papers are written in AMS-LaTeX using the `amsart` document class and live under `papers/`.

## Papers

All papers are at `papers/<name>/paper.tex`. The current set:

| Directory | Title |
|---|---|
| `colored_edge_flip_classes` | Colored Edge Flip Classes |
| `colored_pentagon_contractions` | Colored Pentagon Reductions |
| `coloring_nested_tire_dual_graphs` | Coloring Nested Tire Dual Graphs |
| `even_level_graph_generators` | Even Level Graph Generators: a constructive conjecture stronger than the Four Color Theorem |
| `face_monochromatic_pairs` | Face-Monochromatic Pairs and the Four Colour Theorem |
| `iterated_reduction_in_reduced_dual` | An Iterated Reduction in the Reduced Dual |
| `level_resolutions_of_maximal_planar_graphs` | Level Resolutions of Maximal Planar Graphs |
| `level_switching` | Level Switching |
| `medial_tire_decompositions_of_plane_triangulations` | Medial Tire Decompositions of Plane Triangulations |
| `nested_tire_decompositions_of_plane_triangulations` | Nested Tire Decompositions of Plane Triangulations |
| `plane_depth` | Plane Depth |
| `plane_depth_sequencing` | Plane Depth Sequencing |
| `plane_diamond_coloring` | Plane Diamond Coloring |

The papers form a connected programme around plane triangulations, BFS-level structure, and the Four Colour Theorem. `plane_depth` introduces the level / dual-depth framework that downstream papers build on; `nested_tire_decompositions_of_plane_triangulations` develops the tire-tread tree-of-treads decomposition.

## Creating a New Paper

Use `run.sh` to scaffold a new paper from the AMS-LaTeX template:

```sh
./run.sh init_paper "Your Paper Title"
```

This creates `papers/<name>/` (the name is derived from the title, lower-cased, spaces → underscores) containing a `paper.tex` pre-filled with the title and author.

## Setup

The Python library code in `lib/` requires SageMath. Run setup once per machine:

```sh
./run.sh setup <sage_python_path> <sage_site_packages> [system_name]
```

- `sage_python_path` — path to the SageMath Python interpreter (e.g. `/opt/sage/local/bin/python3`)
- `sage_site_packages` — path to SageMath's site-packages directory
- `system_name` — optional label for this machine (defaults to `hostname -s`); used to store per-machine env files as `.env.<system_name>`

On subsequent runs the paths default to whatever was saved in `.env`, so `./run.sh setup` alone re-runs setup with the existing configuration.

Setup also compiles the [plantri](https://github.com/mishun/plantri) submodule via `make`.

## Running Sage

To run a Sage script with `plantri` available on `PATH`:

```sh
./run.sh sage <script.py> [args...]
```

Or to open an interactive Sage session:

```sh
./run.sh sage
```

## Linting

```sh
./run.sh lint
```

Runs `pyright` and `pylint` on `lib/` using the SageMath Python interpreter.

## Shell Completion

To enable tab-completion for `run.sh` in zsh, add this to your `.zshrc`:

```sh
eval "$(path/to/run.sh completion)"
```

Or source it once in the current shell session:

```sh
eval "$(./run.sh completion)"
```

## Building

Papers are compiled with LaTeX. From within a paper directory:

```sh
latexmk -pdf paper.tex
```
