chore: SAVEPOINT

This commit is contained in:
2026-04-20 16:32:27 -04:00
parent 4728c0b62a
commit 6d977f5e35
12 changed files with 707 additions and 17 deletions
+3
View File
@@ -1,3 +1,6 @@
[submodule "ams-latex-template"]
path = ams-latex-template
url = ssh://git@gitea.dideric.is/didericis/ams-latex-template.git
[submodule "plantri"]
path = plantri
url = https://github.com/mishun/plantri
+38 -6
View File
@@ -26,23 +26,55 @@ This creates a new directory (name derived from the title) containing a `paper.t
## Setup
The Python library code in `lib/` requires SageMath. To set up the linting environment, run:
The Python library code in `lib/` requires SageMath. Run setup once per machine:
```sh
./run.sh setup
./run.sh setup <sage_python_path> <sage_site_packages> [system_name]
```
This creates a `.venv` using the SageMath Python interpreter and installs `pylint` into it.
- `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
To lint the `lib/` directory:
```sh
./run.sh lint
```
This runs `pyright` (via `npx`) and `pylint` using the SageMath Python interpreter.
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
+93
View File
@@ -0,0 +1,93 @@
from sage.all import graphs, Graph
from collections import defaultdict
from pathlib import Path
import base64
DIR = Path(__file__).parent
PALETTE = ['red', 'blue', 'green', 'yellow']
def plot_colored(g, coloring, title, filename):
g.is_planar(set_embedding=True, set_pos=True)
vertex_colors = defaultdict(list)
for v, c in coloring.items():
vertex_colors[PALETTE[c]].append(v)
label = base64.urlsafe_b64encode(g.canonical_label().graph6_string().encode()).decode()
out_dir = DIR / "data" / label
out_dir.mkdir(exist_ok=True)
g.plot(vertex_colors=dict(vertex_colors), title=title).save(out_dir / filename)
def pluck(G: Graph, coloring, v0, kind, step=1):
# Contract v1 and v2 into v0 to obtain the minor G'.
# merge_vertices([v0, v1, v2]) folds v1 and v2 into v0.
G_prime = G.copy()
G_prime.delete_vertex(v0)
coloring_prime = coloring.copy()
del coloring_prime[v0]
print(f"\nG' (after reduction): {G_prime.order()} vertices, {G_prime.size()} edges")
# Plot before and after side by side.
plot_colored(G_prime, coloring_prime, f"G' (after pluck for v0={v0})", f"step_{step:04d}_({kind}).png")
return reduce(G_prime, coloring_prime, step+1)
def squish(G: Graph, coloring, v0, kind, step=1):
# Among v0's neighbors, find two with the same color (v1 and v2).
neighbor_by_color = defaultdict(list)
for v in G.neighbors(v0):
neighbor_by_color[coloring[v]].append(v)
v1, v2 = next(
(vs[0], vs[1]) for vs in neighbor_by_color.values() if len(vs) >= 2
)
print(f"Shared-color neighbors: v1 = {v1}, v2 = {v2} (color {coloring[v1]})")
# Contract v1 and v2 into v0 to obtain the minor G'.
# merge_vertices([v0, v1, v2]) folds v1 and v2 into v0.
G_prime = G.copy()
G_prime.merge_vertices([v0, v1, v2])
coloring_prime = {v: c for v, c in coloring.items() if v not in (v1, v2)}
coloring_prime[v0] = coloring[v1]
print(f"\nG' (after reduction): {G_prime.order()} vertices, {G_prime.size()} edges")
# Plot before and after side by side.
plot_colored(G_prime, coloring_prime, f"G' (after squish for v0={v0}, v1={v1}, v2={v2})", f"step_{step:04d}_({kind}).png")
return reduce(G_prime, coloring_prime, step+1)
def reduce(G, coloring, step=1):
# 2. Find a proper 4-coloring.
# G.coloring() returns a partition of vertices into color classes.
# By pigeonhole (5 neighbors, at most 3 available colors for each
# degree-5 vertex), the reduction step below always succeeds.
print(f"Coloring: {coloring}")
degree_4_candidates = []
degree_5_candidates = []
# Pick the first degree 5 vertex where the neighbors form a wheel
for v in G.vertices():
if G.degree(v) == 3 and G.subgraph(G.neighbors(v)).is_cycle():
return pluck(G, coloring, v, 'triangle', step)
elif G.degree(v) == 4 and G.subgraph(G.neighbors(v)).is_cycle():
degree_4_candidates.append(v)
elif G.degree(v) == 5 and G.subgraph(G.neighbors(v)).is_cycle():
degree_5_candidates.append(v)
for v in degree_4_candidates:
return squish(G, coloring, v, 'square', step)
for v in degree_5_candidates:
return squish(G, coloring, v, 'triangle', step)
print("DONE")
return
# 1. Generate a maximal planar graph (triangulation) on 14 vertices
# with minimum degree 5, via plantri.
G = next(graphs.planar_graphs(20, minimum_degree=5))
print(f"G: {G.order()} vertices, {G.size()} edges")
print(f"Degree sequence: {sorted(G.degree_sequence(), reverse=True)}")
coloring_classes = G.coloring()
coloring = {v: i for i, cls in enumerate(coloring_classes) for v in cls}
plot_colored(G, coloring, "Start", f"step_{0:04d}.png")
reduce(G, coloring)
+8
View File
@@ -0,0 +1,8 @@
\relax
\newlabel{tocindent-1}{0pt}
\newlabel{tocindent0}{0pt}
\newlabel{tocindent1}{17.77782pt}
\newlabel{tocindent2}{0pt}
\newlabel{tocindent3}{0pt}
\@writefile{toc}{\contentsline {section}{\tocsection {}{1}{Definitions}}{1}{}\protected@file@percent }
\gdef \@abspage@last{1}
@@ -0,0 +1,55 @@
# Fdb version 3
["pdflatex"] 1776480052 "/Users/didericis/Code/math-research/colored_pentagon_reduction/paper.tex" "paper.pdf" "paper" 1776480052
"/Users/didericis/Code/math-research/colored_pentagon_reduction/paper.tex" 1776480051 3987 2b5eed20ba96c5341a605819095252cf ""
"/usr/local/texlive/2022/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm" 1246382020 1004 54797486969f23fa377b128694d548df ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex8.tfm" 1246382020 988 bdf658c3bfc2d96d3c8b02cfc1c94c20 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm" 1246382020 916 f87d7c45f9c908e672703b83b72241a3 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam5.tfm" 1246382020 924 9904cf1d39e9767e7a3622f2a125a565 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm" 1246382020 928 2dc8d444221b7a635bb58038579b861a ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm" 1246382020 908 2921f8a10601f252058503cc6570e581 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm5.tfm" 1246382020 940 75ac932a52f80982a9f8ea75d03a34cf ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm" 1246382020 940 228d6584342e91276bf566bcf9716b83 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm" 1136768653 1328 c834bbb027764024c09d3d2bf908b5f0 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmcsc10.tfm" 1136768653 1300 63a6111ee6274895728663cf4b4e7e81 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm" 1136768653 1512 f21f83efb36853c0b70002322c1ab3ad ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm" 1136768653 1520 eccf95517727cb11801f4f1aee3a21b4 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmr6.tfm" 1136768653 1300 b62933e007d01cfd073f79b963c01526 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmr8.tfm" 1136768653 1292 21c1c5bfeaebccffdb478fd231a0997d ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm" 1136768653 1116 933a60c408fc0a863a92debe84b2d294 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm" 1136768653 1120 8b7d695260f3cff42e636090a8002094 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmti10.tfm" 1136768653 1480 aa8e34af0eb6a2941b776984cf1dfdc4 ""
"/usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmti8.tfm" 1136768653 1504 1747189e0441d1c18f3ea56fafc1c480 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb" 1248133631 34811 78b52f49e893bcba91bd7581cdc144c0 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfb" 1248133631 32001 6aeea3afe875097b1eb0da29acd61e28 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb" 1248133631 30251 6afa5cb1d0204815a708a080681d4674 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb" 1248133631 36299 5f9df58c2139e7edcf37c8fca4bd384d ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb" 1248133631 36281 c355509802a035cadc5f15869451dcee ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1248133631 35752 024fb6c41858982481f6968b5fc26508 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb" 1248133631 32762 224316ccc9ad3ca0423a14971cfa7fc1 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb" 1248133631 32726 0a1aea6fcd6468ee2cf64d891f5c43c8 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb" 1248133631 32569 5e5ddc8df908dea60932f3c484a54c0d ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.pfb" 1248133631 32716 08e384dc442464e7285e891af9f45947 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb" 1248133631 37944 359e864bd06cde3b1cf57bb20757fb06 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmti8.pfb" 1248133631 35660 fb24af7afbadb71801619f1415838111 ""
"/usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/symbols/msam10.pfb" 1248133631 31764 459c573c03a4949a528c2cc7f557e217 ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls" 1591045760 61881 a7369c346c2922a758ae6283cc1ed014 ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty" 1359763108 5949 3f3fd50a8cc94c3d4cbf4fc66cd3df1c ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd" 1359763108 961 6518c6525a34feb5e8250ffa91731cff ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd" 1359763108 961 d02606146ba5601b5645f987c92e6193 ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty" 1622667781 2222 da905dc1db75412efd2d8f67739f0596 ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty" 1622667781 4173 bc0410bcccdff806d6132d3c1ef35481 ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty" 1636758526 87648 07fbb6e9169e00cb2a2f40b31b2dbf3c ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty" 1636758526 4128 8eea906621b6639f7ba476a472036bbe ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty" 1636758526 2444 926f379cc60fcf0c6e3fee2223b4370d ""
"/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def" 1644269979 29921 d0acc05a38bd4aa3af2017f0b7c137ce ""
"/usr/local/texlive/2022/texmf-dist/web2c/texmf.cnf" 1646502317 40171 cdab547de63d26590bebb3baff566530 ""
"/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map" 1647878959 4410336 7d30a02e9fa9a16d7d1f8d037ba69641 ""
"/usr/local/texlive/2022/texmf-var/web2c/pdftex/pdflatex.fmt" 1665017617 2826443 7e98410c533054b636c6470db83a27bc ""
"/usr/local/texlive/2022/texmf.cnf" 1647878952 577 209b46be99c9075fd74d4c0369380e8c ""
"paper.aux" 1776480052 278 33f9a0345524212ba8a94d953b72f3ec "pdflatex"
"paper.tex" 1776480051 3987 2b5eed20ba96c5341a605819095252cf ""
(generated)
"paper.aux"
"paper.log"
"paper.pdf"
+160
View File
@@ -0,0 +1,160 @@
PWD /Users/didericis/Code/math-research/colored_pentagon_reduction
INPUT /usr/local/texlive/2022/texmf.cnf
INPUT /usr/local/texlive/2022/texmf-dist/web2c/texmf.cnf
INPUT /usr/local/texlive/2022/texmf-var/web2c/pdftex/pdflatex.fmt
INPUT /Users/didericis/Code/math-research/colored_pentagon_reduction/paper.tex
OUTPUT paper.log
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
INPUT ./paper.aux
INPUT paper.aux
INPUT paper.aux
OUTPUT paper.aux
INPUT /usr/local/texlive/2022/texmf-dist/fonts/map/fontname/texfonts.map
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmr8.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmr6.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex8.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam5.tfm
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
INPUT /usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm5.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmcsc10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmti8.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmcsc10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm
INPUT /usr/local/texlive/2022/texmf-dist/fonts/tfm/public/cm/cmti10.tfm
OUTPUT paper.pdf
INPUT /usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map
INPUT paper.aux
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmti8.pfb
INPUT /usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/symbols/msam10.pfb
+149
View File
@@ -0,0 +1,149 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.10.5) 17 APR 2026 22:40
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**/Users/didericis/Code/math-research/colored_pentagon_reduction/paper.tex
(/Users/didericis/Code/math-research/colored_pentagon_reduction/paper.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24> (/usr/local/texlive/2022/texmf-dist/tex/latex/amscls/amsart.cls
Document Class: amsart 2020/05/29 v2.20.6
\linespacing=\dimen138
\normalparindent=\dimen139
\normaltopskip=\skip47
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2021/10/15 v2.17l AMS math features
\@mathmargin=\skip48
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks16
\ex@=\dimen140
)) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen141
) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2021/08/26 v2.02 operator names
)
\inf@bad=\count185
LaTeX Info: Redefining \frac on input line 234.
\uproot@=\count186
\leftroot@=\count187
LaTeX Info: Redefining \overline on input line 399.
\classnum@=\count188
\DOTSCASE@=\count189
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox@=\box50
\strutbox@=\box51
\big@size=\dimen142
LaTeX Font Info: Redeclaring font encoding OML on input line 743.
LaTeX Font Info: Redeclaring font encoding OMS on input line 744.
\macc@depth=\count190
\c@MaxMatrixCols=\count191
\dotsspace@=\muskip16
\c@parentequation=\count192
\dspbrk@lvl=\count193
\tag@help=\toks17
\row@=\count194
\column@=\count195
\maxfields@=\count196
\andhelp@=\toks18
\eqnshift@=\dimen143
\alignsep@=\dimen144
\tagshift@=\dimen145
\tagwidth@=\dimen146
\totwidth@=\dimen147
\lineht@=\dimen148
\@envbody=\toks19
\multlinegap=\skip49
\multlinetaggap=\skip50
\mathdisplay@stack=\toks20
LaTeX Info: Redefining \[ on input line 2938.
LaTeX Info: Redefining \] on input line 2939.
)
LaTeX Font Info: Trying to load font information for U+msa on input line 397.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
)
\copyins=\insert199
\abstractbox=\box52
\listisep=\skip51
\c@part=\count197
\c@section=\count198
\c@subsection=\count266
\c@subsubsection=\count267
\c@paragraph=\count268
\c@subparagraph=\count269
\c@figure=\count270
\c@table=\count271
\abovecaptionskip=\skip52
\belowcaptionskip=\skip53
\captionindent=\dimen149
\thm@style=\toks21
\thm@bodyfont=\toks22
\thm@headfont=\toks23
\thm@notefont=\toks24
\thm@headpunct=\toks25
\thm@preskip=\skip54
\thm@postskip=\skip55
\thm@headsep=\skip56
\dth@everypar=\toks26
)
\c@theorem=\count272
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count273
\l__pdf_internal_box=\box53
) (./paper.aux)
\openout1 = `paper.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 52.
LaTeX Font Info: ... okay on input line 52.
LaTeX Font Info: Trying to load font information for U+msa on input line 52.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info: Trying to load font information for U+msb on input line 52.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
) [1{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./paper.aux) )
Here is how much of TeX's memory you used:
1715 strings out of 478268
24101 string characters out of 5846347
324202 words of memory out of 5000000
19800 multiletter control sequences out of 15000+600000
475666 words of font info for 53 fonts, out of 8000000 for 9000
1302 hyphenation exceptions out of 8191
69i,9n,76p,582b,204s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmti8.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/symbols/msam10.pfb>
Output written on paper.pdf (1 page, 148889 bytes).
PDF statistics:
73 PDF objects out of 1000 (max. 8388607)
43 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
Binary file not shown.
Binary file not shown.
+114
View File
@@ -0,0 +1,114 @@
%% filename: amsart-template.tex
%% version: 1.1
%% date: 2014/07/24
%%
%% American Mathematical Society
%% Technical Support
%% Publications Technical Group
%% 201 Charles Street
%% Providence, RI 02904
%% USA
%% tel: (401) 455-4080
%% (800) 321-4267 (USA and Canada only)
%% fax: (401) 331-3842
%% email: tech-support@ams.org
%%
%% Copyright 2008-2010, 2014 American Mathematical Society.
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is the American Mathematical
%% Society.
%%
%% ====================================================================
% AMS-LaTeX v.2 template for use with amsart
%
% Remove any commented or uncommented macros you do not use.
\documentclass{amsart}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{xca}[theorem]{Exercise}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\numberwithin{equation}{section}
\begin{document}
\title{Colored Pentagon Reductions}
% Remove any unused author tags.
% author one information
\author{Eric Bauerfeld}
\address{}
\curraddr{}
\email{}
\thanks{}
\subjclass[2010]{Primary }
\keywords{}
\date{}
\dedicatory{}
\begin{abstract}
We investigate specific types of minors we can obtain by a sequence of contractions of two incident to a sequence of vertices of degree 5 relative to a proper coloring.
\end{abstract}
\maketitle
\section{Definitions}
\begin{definition}
Let $G$ be a maximal planar graph with a proper 4-coloring $c : V(G) \to \{1,2,3,4\}$. A \emph{colored pentagon reduction} is a function
\[
R : (G, c, v_0, v_1, v_2) \mapsto G / \{v_1 v_0,\, v_2 v_0\}
\]
where $v_0 \in V(G)$ has degree 5, $v_1$ and $v_2$ are adjacent vertices satisfying $c(v_1) = c(v_2)$, and $G / \{v_1 v_0,\, v_2 v_0\}$ denotes the minor obtained by contracting $v_1$ and $v_2$ each into $v_0$.
\end{definition}
\begin{lemma}
If $G' = R(G, c, v_0, v_1, v_2)$, then $G'$ has a proper 4-coloring.
\end{lemma}
\begin{proof}
The idea is to recolor $v_0$ with the shared color of $v_1$ and $v_2$, and check that this creates no new conflicts.
Let $\alpha = c(v_1) = c(v_2)$ and define $c' : V(G') \to \{1,2,3,4\}$ by
\[
c'(v) = \begin{cases} \alpha & \text{if } v = v_0, \\ c(v) & \text{otherwise.} \end{cases}
\]
Every edge of $G'$ not incident to $v_0$ is an edge of $G$ between vertices outside $\{v_1, v_2\}$, so those edges are still properly colored. It remains to check edges $v_0 w$ in $G'$, i.e., that no neighbor of $v_0$ in $G'$ also has color $\alpha$.
Since $c(v_1) = c(v_2)$ and $c$ is proper, $v_1$ and $v_2$ cannot be adjacent in $G$, so they are non-adjacent in the 5-cycle induced by $N_G(v_0)$ (which exists because $G$ is maximal planar). One can check that in any 5-cycle, two non-adjacent vertices together cover every other vertex --- that is, every remaining vertex is adjacent to at least one of them. Therefore every $w \in N_G(v_0) \setminus \{v_1, v_2\}$ is adjacent in $G$ to $v_1$ or $v_2$, so $c(w) \neq \alpha = c'(v_0)$.
For new neighbors of $v_0$ coming from the contraction, namely $w \in (N_G(v_1) \cup N_G(v_2)) \setminus \{v_0, v_1, v_2\}$, we get $c(w) \neq \alpha = c'(v_0)$ for free since $c$ is proper on $G$.
Hence $c'$ is a proper 4-coloring of $G'$.
\end{proof}
\end{document}
%-----------------------------------------------------------------------
% End of amsart-template.tex
%-----------------------------------------------------------------------
Submodule
+1
Submodule plantri added at 09745aeb09
+83 -8
View File
@@ -14,6 +14,10 @@ init_paper() {
local name
name="$(printf '%s' "$raw" | tr '[:upper:]' '[:lower:]' | tr -d '\\' | tr '[:space:]' '_')"
local dest="$SCRIPT_DIR/$name"
if [ -d "$dest" ]; then
echo "Error: '$dest' already exists" >&2
exit 1
fi
mkdir -p "$dest"
cp "$SCRIPT_DIR/ams-latex-template/doc/amsart-template.tex" "$dest/paper.tex"
sed -i '' "s|\\\\title{}|\\\\title{$raw}|" "$dest/paper.tex"
@@ -23,20 +27,20 @@ init_paper() {
}
setup() {
local python_path="${1:?Usage: setup <python_path> <sage_site_packages> <system_name>}"
local sage_site_packages="${2:?Usage: setup <python_path> <sage_site_packages> <system_name>}"
local system_name="${3:?Usage: setup <python_path> <sage_site_packages> <system_name>}"
local sage_python_path="${1:-${SAGE_PYTHON_PATH:?Usage: setup <sage_python_path> <sage_site_packages> <system_name>}}"
local sage_site_packages="${2:-${SAGE_SITE_PACKAGES:?Usage: setup <sage_python_path> <sage_site_packages> <system_name>}}"
local system_name="${3:-$(hostname -s)}"
printf 'SAGE_PYTHON_PATH=%s\nSAGE_SITE_PACKAGES=%s\n' "$python_path" "$sage_site_packages" \
printf 'SAGE_PYTHON_PATH=%s\nSAGE_SITE_PACKAGES=%s\n' "$sage_python_path" "$sage_site_packages" \
>"$SCRIPT_DIR/.env.$system_name"
ln -sf ".env.$system_name" "$SCRIPT_DIR/.env"
source "$SCRIPT_DIR/.env"
mkdir -p "$SCRIPT_DIR/.vscode"
"$python_path" - <<EOF
"$sage_python_path" - <<EOF
import json
settings = {
"python.defaultInterpreterPath": "$python_path",
"python.defaultInterpreterPath": "$sage_python_path",
"python.analysis.extraPaths": ["$sage_site_packages"],
"python.analysis.diagnosticSeverityOverrides": {
"reportUnknownMemberType": "warning",
@@ -51,10 +55,16 @@ with open("$SCRIPT_DIR/.vscode/settings.json", "w") as f:
f.write("\n")
EOF
"$python_path" -m venv "$SCRIPT_DIR/.venv"
make -C "$SCRIPT_DIR/plantri"
"$sage_python_path" -m venv "$SCRIPT_DIR/.venv"
"$VENV_PYTHON" -m pip install -r "$SCRIPT_DIR/requirements.txt"
}
run_sage() {
PATH="$PATH:$SCRIPT_DIR/plantri" sage "$@"
}
lint() {
"$VENV_PYTHON" -m pyright lib/ --pythonpath "$SAGE_PYTHON_PATH"
"$VENV_PYTHON" -m pylint lib/ \
@@ -62,6 +72,63 @@ lint() {
--disable=fixme
}
completion() {
local shell="${1:-zsh}"
case "$shell" in
zsh)
cat <<'EOF'
_run_sh() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'1: :->subcmd' \
'*: :->args'
case $state in
subcmd)
local subcmds=(
'init_paper:Initialize a new paper directory from the AMS template'
'setup:Configure Python/Sage environment and install dependencies'
'sage:Run sage with plantri available on PATH'
'lint:Run pyright and pylint on lib/'
'completion:Output shell completion code'
)
_describe 'subcommand' subcmds
;;
args)
case $words[2] in
init_paper)
_message 'paper title (spaces become underscores)'
;;
setup)
case $((CURRENT - 2)) in
1) _files ;;
2) _files -/ ;;
3) _message 'system name (e.g. macbook, workstation)' ;;
esac
;;
sage)
_files
;;
completion)
_values 'shell' 'zsh'
;;
esac
;;
esac
}
compdef _run_sh run.sh
EOF
;;
*)
echo "Unsupported shell: $shell. Supported: zsh" >&2
exit 1
;;
esac
}
case "${1:-}" in
init_paper)
shift
@@ -71,11 +138,19 @@ setup)
shift
setup "$@"
;;
sage)
shift
run_sage "$@"
;;
lint)
lint
;;
completion)
shift
completion "$@"
;;
*)
echo "Usage: $0 {init_paper|setup|lint} [args]" >&2
echo "Usage: $0 {init_paper|setup|sage|lint|completion} [args]" >&2
exit 1
;;
esac