Skip to content

Chapters 10 and 13 - #69

Open
felipponn wants to merge 16 commits into
cslib-community:mainfrom
felipponn:main
Open

Chapters 10 and 13#69
felipponn wants to merge 16 commits into
cslib-community:mainfrom
felipponn:main

Conversation

@felipponn

Copy link
Copy Markdown

In this pull request, we use the TimeM monad and systematically extends the codebase to support time complexity analysis for algorithms in Chapter 13, including Fibonacci, binomial coefficients, and the knapsack problem.

Beyond that, we create the structure for Chapter 10, choosing to implement the ThinBy multi-function as a predicate. All sections are implemented, and some exercises are suggested.

felipponn and others added 16 commits June 30, 2026 14:46
Under the current Lean/Mathlib toolchain, `simp only [..., decide_eq_true_eq,
<proj-lemmas>]` no longer strips `decide P = true` to `P` when projection
rfl-lemmas (`residue`/`count`/`value_add`/`weight_add`) are unfolded in the
same call: `decide_eq_true_eq` is reported unused and the goal stays wrapped
in `decide (…) = true`, so the following `constructor` / `calc` / `⟨_, _⟩`
steps fail (no `And` constructor; `calc` type mismatch; `Eq.refl` given 2
fields).

Fix: strip the `decide` in its own `simp only [_, decide_eq_true_eq]` pass
first, then unfold the projections in a second step. Three sites across the
two `key_fact` theorems (coin-change and knapsack). No statements changed;
the whole `Fad` library builds again (8696 jobs, 0 errors).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbkMyCwYRAiUy3NFwn9M4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants