Skip to content

Commit f1c5120

Browse files
Jonathan Gadea HarderJonathan Gadea Harder
authored andcommitted
feat: add leanblueprint setup with GitHub Pages deployment
- Add blueprint/ folder with LaTeX structure for formalization dependency graph - Write comprehensive content.tex with 7 chapters covering all major results - Create GitHub Pages workflow for automatic deployment - Update lake-manifest.json and lean-toolchain The blueprint documents the formalization structure including: - Preliminaries (probability, Hoeffding) - Drift theorems (additive, multiplicative, negative) - Game theory (minimax, witness games, veto) - LBT preconditions (G1, G2, G3) - Coupling arguments - Applications (FIFO traps, epistasis, persistence) - Capstone validation (28 conjuncts)
1 parent 580cef7 commit f1c5120

31 files changed

Lines changed: 2342 additions & 14 deletions

.github/workflows/blueprint.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Blueprint to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install Elan
25+
run: |
26+
curl -sSfL https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | sh -s -- -y --default-toolchain none
27+
echo "$HOME/.elan/bin" >> $GITHUB_PATH
28+
29+
- name: Cache Mathlib
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
.lake/packages/mathlib
34+
.lake/build
35+
key: lake-${{ runner.os }}-${{ hashFiles('lakefile.lean', 'lake-manifest.json', 'lean-toolchain') }}
36+
restore-keys: lake-${{ runner.os }}-
37+
38+
- name: Build project
39+
run: lake build
40+
41+
- name: Install Python dependencies
42+
run: |
43+
pip install leanblueprint
44+
45+
- name: Install LaTeX
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y texlive-full
49+
50+
- name: Build blueprint web
51+
run: leanblueprint web
52+
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: blueprint/web
57+
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

blueprint/src/blueprint.sty

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
\DeclareOption*{}
2+
\ProcessOptions
3+
4+
\newcommand{\graphcolor}[3]{}

blueprint/src/content.tex

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
% Blueprint for Level-Based Theorem Formalization
2+
% This file contains the dependency graph and proof structure
3+
% for the formal verification of runtime analysis results.
4+
5+
\chapter{Preliminaries}
6+
7+
\section{Probability foundations}
8+
\begin{definition}[Probability space]
9+
\label{def:prob_space}
10+
A probability space $(\Omega, \mathcal{F}, P)$ with sample space, $\sigma$-algebra, and measure.
11+
\lean{MeasureTheory.ProbabilityMeasure}
12+
\mathlibok
13+
\end{definition}
14+
15+
\begin{definition}[Expected value]
16+
\label{def:expected_value}
17+
For random variable $X$ on probability space, $\mathbb{E}[X] = \int X \, dP$.
18+
\lean{MeasureTheory.integral}
19+
\mathlibok
20+
\end{definition}
21+
22+
\begin{definition}[Conditional expectation]
23+
\label{def:conditional_expectation}
24+
$\mathbb{E}[X \mid \mathcal{G}]$ for sub-$\sigma$-algebra $\mathcal{G}$.
25+
\lean{MeasureTheory.condExp}
26+
\mathlibok
27+
\end{definition}
28+
29+
\begin{lemma}[Hoeffding's inequality]
30+
\label{lem:hoeffding}
31+
For independent bounded random variables $X_1, \ldots, X_n$ with $a_i \leq X_i \leq b_i$:
32+
\[ P\left(\sum_{i=1}^n (X_i - \mathbb{E}[X_i]) \geq t\right) \leq \exp\left(-\frac{2t^2}{\sum_{i=1}^n (b_i - a_i)^2}\right) \]
33+
\lean{Hoeffding.hoeffding_ineq}
34+
\uses{def:expected_value}
35+
\leanok
36+
\end{lemma}
37+
38+
\section{Ranking and selection}
39+
\begin{definition}[Ranking function]
40+
\label{def:ranking}
41+
A ranking function $\text{rank}: S \to \mathbb{R}$ that assigns fitness values to solutions.
42+
\lean{CRNRanking.Ranking}
43+
\end{definition}
44+
45+
\begin{definition}[Ranking gap]
46+
\label{def:ranking_gap}
47+
For target set $T$, the gap $\Delta = \min_{x \notin T} (\text{rank}(x^*) - \text{rank}(x))$.
48+
\lean{CRNRanking.Gap}
49+
\uses{def:ranking}
50+
\end{definition}
51+
52+
\chapter{Drift Theorems}
53+
54+
\section{Additive drift}
55+
\begin{theorem}[Additive drift theorem]
56+
\label{thm:additive_drift}
57+
If $\mathbb{E}[X_{t+1} - X_t \mid X_t] \geq \delta > 0$ for $X_t \notin T$, then $\mathbb{E}[\tau] \leq X_0 / \delta$.
58+
\lean{DriftTheorems.AdditiveDrift.additive_drift_theorem}
59+
\uses{def:expected_value}
60+
\leanok
61+
\end{theorem}
62+
63+
\section{Multiplicative drift}
64+
\begin{theorem}[Multiplicative drift theorem]
65+
\label{thm:multiplicative_drift}
66+
If $\mathbb{E}[X_{t+1} \mid X_t] \leq (1 - \delta) X_t$ for $X_t \notin T$, then $\mathbb{E}[\tau] \leq \frac{\ln(X_0)}{\delta}$.
67+
\lean{DriftTheorems.MultiplicativeDrift.multiplicative_drift_theorem}
68+
\uses{def:expected_value}
69+
\leanok
70+
\end{theorem}
71+
72+
\section{Negative drift}
73+
\begin{theorem}[Negative drift theorem]
74+
\label{thm:negative_drift}
75+
If $\mathbb{E}[X_{t+1} - X_t \mid X_t] \leq -\delta < 0$ and bounded variance, then $\tau$ is exponentially large.
76+
\lean{DriftTheorems.NegativeDrift.negative_drift_theorem}
77+
\uses{def:expected_value, lem:hoeffding}
78+
\leanok
79+
\end{theorem}
80+
81+
\chapter{Game Theory}
82+
83+
\section{Minimax theorem}
84+
\begin{theorem}[Minimax theorem]
85+
\label{thm:minimax}
86+
For zero-sum game with payoff matrix $A$:
87+
\[ \max_x \min_y x^T A y = \min_y \max_x x^T A y \]
88+
\lean{GameTheoryMinimax.minimax_theorem}
89+
\leanok
90+
\end{theorem}
91+
92+
\section{Witness games}
93+
\begin{definition}[Witness game]
94+
\label{def:witness_game}
95+
A game structure for analyzing coevolutionary dynamics.
96+
\lean{WitnessGameDrift.WitnessGame}
97+
\end{definition}
98+
99+
\begin{lemma}[Witness game drift]
100+
\label{lem:witness_drift}
101+
The witness game exhibits positive drift toward target solutions.
102+
\lean{WitnessGameDrift.witness_game_drift}
103+
\uses{def:witness_game, thm:additive_drift}
104+
\leanok
105+
\end{lemma}
106+
107+
\section{Veto mechanism}
108+
\begin{definition}[Veto player]
109+
\label{def:veto_player}
110+
A player that can reject candidate solutions.
111+
\lean{WitnessVeto.VetoPlayer}
112+
\end{definition}
113+
114+
\begin{lemma}[Veto bounds]
115+
\label{lem:veto_bounds}
116+
The veto mechanism provides runtime bounds for escaping local optima.
117+
\lean{WitnessVeto.veto_runtime_bound}
118+
\uses{def:veto_player, thm:multiplicative_drift}
119+
\leanok
120+
\end{lemma}
121+
122+
\chapter{Linear Ranking and LBT Preconditions}
123+
124+
\section{Linear ranking theorem}
125+
\begin{definition}[LBT precondition G1]
126+
\label{def:precond_G1}
127+
Condition for selection to amplify target solutions.
128+
\lean{LBTPreconditions.precond_G1}
129+
\uses{def:ranking}
130+
\end{definition}
131+
132+
\begin{definition}[LBT precondition G2]
133+
\label{def:precond_G2}
134+
Condition for variation to maintain diversity.
135+
\lean{LBTPreconditions.precond_G2}
136+
\end{definition}
137+
138+
\begin{definition}[LBT precondition G3]
139+
\label{def:precond_G3}
140+
Condition for population size sufficiency.
141+
\lean{LBTPreconditions.precond_G3}
142+
\end{definition}
143+
144+
\begin{theorem}[Linear ranking theorem]
145+
\label{thm:linear_ranking}
146+
Under preconditions G1, G2, G3, the level-based theorem provides runtime bounds.
147+
\lean{CoEALevelBased.level_based_theorem}
148+
\uses{def:precond_G1, def:precond_G2, def:precond_G3, thm:additive_drift}
149+
\leanok
150+
\end{theorem}
151+
152+
\section{Selection amplification}
153+
\begin{lemma}[Selection amplification bound]
154+
\label{lem:sel_amplification}
155+
Selection increases the proportion of target solutions by factor $(1 + \delta)$.
156+
\lean{LBTCoupling.sel_amplification_bound}
157+
\uses{def:precond_G1, def:ranking_gap}
158+
\notready
159+
\end{lemma}
160+
161+
\chapter{Coupling Arguments}
162+
163+
\section{LBT Coupling}
164+
\begin{definition}[Coupling]
165+
\label{def:coupling}
166+
A coupling between the idealized and actual process distributions.
167+
\lean{LBTCoupling.Coupling}
168+
\end{definition}
169+
170+
\begin{theorem}[LBT coupling theorem]
171+
\label{thm:lbt_coupling}
172+
The coupled process tracks the idealized LBT process with bounded error.
173+
\lean{LBTCoupling.lbt_coupling_theorem}
174+
\uses{def:coupling, thm:linear_ranking}
175+
\notready
176+
\end{theorem}
177+
178+
\begin{lemma}[G2 monotonicity]
179+
\label{lem:g2_monotonicity}
180+
The G2 condition is preserved under the coupling.
181+
\lean{LBTCoupling.r_local_G2}
182+
\uses{def:precond_G2, def:coupling}
183+
\notready
184+
\end{lemma}
185+
186+
\section{Runtime bounds}
187+
\begin{theorem}[Runtime bound]
188+
\label{thm:runtime_bound}
189+
The expected runtime is $O(n \log n)$ for the level-based algorithm.
190+
\lean{CoEALevelBased.runtime_bound}
191+
\uses{thm:lbt_coupling, thm:additive_drift}
192+
\leanok
193+
\end{theorem}
194+
195+
\chapter{Applications}
196+
197+
\section{FIFO trap obstruction}
198+
\begin{definition}[FIFO trap]
199+
\label{def:fifo_trap}
200+
A trap configuration that blocks progress in FIFO-based algorithms.
201+
\lean{FifoTrapObstruction.FIFOTrap}
202+
\end{definition}
203+
204+
\begin{theorem}[FIFO trap runtime]
205+
\label{thm:fifo_trap_runtime}
206+
FIFO traps cause exponential runtime for certain problem instances.
207+
\lean{FifoTrapObstruction.fifo_trap_exponential}
208+
\uses{def:fifo_trap, thm:negative_drift}
209+
\leanok
210+
\end{theorem}
211+
212+
\section{Signed epistasis}
213+
\begin{definition}[Signed epistasis skeleton]
214+
\label{def:epistasis}
215+
A structure encoding epistatic interactions in fitness landscapes.
216+
\lean{SignedEpistasisSkeleton.SignedEpistasis}
217+
\end{definition}
218+
219+
\begin{lemma}[Epistasis bounds]
220+
\label{lem:epistasis_bounds}
221+
Signed epistasis provides bounds on the number of fitness levels.
222+
\lean{SignedEpistasisSkeleton.epistasis_level_bound}
223+
\uses{def:epistasis, def:ranking}
224+
\leanok
225+
\end{lemma}
226+
227+
\section{Simultaneous persistence}
228+
\begin{theorem}[Simultaneous persistence]
229+
\label{thm:simultaneous_persistence}
230+
Under coevolutionary dynamics, multiple strategies can persist simultaneously.
231+
\lean{SimultaneousPersistence.simultaneous_persistence_theorem}
232+
\uses{thm:minimax, lem:witness_drift}
233+
\leanok
234+
\end{theorem}
235+
236+
\chapter{Capstone Validation}
237+
238+
\section{Unified paper validation}
239+
\begin{theorem}[Full paper capstone]
240+
\label{thm:full_paper_capstone}
241+
The 28 conjuncts of the paper are formally verified, covering:
242+
\begin{enumerate}
243+
\item LBT preconditions (G1, G2, G3)
244+
\item Linear ranking theorem
245+
\item Selection amplification
246+
\item Coupling arguments
247+
\item Runtime bounds
248+
\item Applications (FIFO traps, epistasis, persistence)
249+
\end{enumerate}
250+
\lean{UnifiedPaperValidation.full_paper_capstone}
251+
\uses{thm:linear_ranking, thm:runtime_bound, thm:fifo_trap_runtime, lem:epistasis_bounds, thm:simultaneous_persistence}
252+
\leanok
253+
\end{theorem}

blueprint/src/extra_styles.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* This file contains CSS tweaks for this blueprint.
2+
* As an example, we included CSS rules that put
3+
* a vertical line on the left of theorem statements
4+
* and proofs.
5+
* */
6+
7+
div.theorem_thmcontent {
8+
border-left: .15rem solid black;
9+
}
10+
11+
div.proposition_thmcontent {
12+
border-left: .15rem solid black;
13+
}
14+
15+
div.lemma_thmcontent {
16+
border-left: .1rem solid black;
17+
}
18+
19+
div.corollary_thmcontent {
20+
border-left: .1rem solid black;
21+
}
22+
23+
div.proof_content {
24+
border-left: .08rem solid grey;
25+
}

blueprint/src/latexmkrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file configures the latexmk command you can use to compile
2+
# the pdf version of the blueprint
3+
$pdf_mode = 1;
4+
$pdflatex = 'xelatex -synctex=1';
5+
@default_files = ('print.tex');

blueprint/src/macros/common.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
% In this file you should put all LaTeX macros and settings to be used both by
2+
% the pdf version and the web version.
3+
% This should be most of your macros.
4+
5+
% The theorem-like environments defined below are those that appear by default
6+
% in the dependency graph. See the README of leanblueprint if you need help to
7+
% customize this.
8+
% The configuration below use the theorem counter for all those environments
9+
% (this is what the [theorem] arguments mean) and never resets it.
10+
% If you want for instance to number them within chapters then you can add
11+
% [chapter] at the end of the next line.
12+
\newtheorem{theorem}{Theorem}
13+
\newtheorem{proposition}[theorem]{Proposition}
14+
\newtheorem{lemma}[theorem]{Lemma}
15+
\newtheorem{corollary}[theorem]{Corollary}
16+
17+
\theoremstyle{definition}
18+
\newtheorem{definition}[theorem]{Definition}

0 commit comments

Comments
 (0)