# Presentation review

Reviewed all 21 presentations, including PINN. The revised collection contains 862 slides, including 161 added foundation/lab slides, and 21 independent runnable programs.

## What changed

Each older deck now has three foundation slides plus five coding-lab slides. The labs contain their own inputs, complete source, setup instructions, captured output, checks, and exercises with explanations. All decks provide reading/slide navigation and code downloads; related presentations are optional rather than prerequisites.

Corrections address mathematical assumptions, false universal claims, incomplete-code labeling, shape/API details, and algorithm limitations. Original material and diagrams were retained where useful. The detailed correction definitions are in `corrections.json` and `clarifications.json`.

## Verification

- 21 standalone programs were tested and executed from isolated temporary directories.
- 6,220 executed checks passed. These are finite checks, not universal proofs.
- The PINN was retrained for 2,500 steps; results are recorded in `verification.json`.
- JavaScript syntax, local links, slide IDs, and embedded source equality are checked by `tools/verify_presentations.py`.
- Browser rendering remains unverified: Chromium and Firefox could not render under this machine's process restrictions. No screenshot/layout success is claimed.

## Per-deck review

### Adaptive Neural Infrastructure with Memory Accumulation

- Switch-style load balancing equals 1 at uniform routing, but that is not a universal minimum; imbalance does not always increase it.
- KV caching computes new Q, K, and V; cache size is bounded by context/eviction policy, not forever.
- Remove speculative GPT-4 architecture and universal production/quality claims; distinguish research proposals from deployed systems.
- MoD routing is not guaranteed to mean easy/hard token identification; early exit and MoD use different mechanisms.
- MemoryBank hard write gate receives no gradient and can fill; provide a causal, user-scoped, resettable working example.

### Weakest Preconditions — Explained Simply

- Python allows negative list indices; nonnegative index constraints are an API convention, not the exact language-definedness wp.
- Loop weakest preconditions exist via fixed points; invariants establish sufficient preconditions, not automatically the weakest one.
- A termination variant need not reach zero if the guard stops earlier.
- Clarify mathematical proof vs sampled tests and optimized-away asserts.

### The Science of Programming — Explained Simply

- Remove dependency on companion decks for foundations; add own contract/logic/WP basics and complete executable program.
- State proof assumptions explicitly; arithmetic/definedness and correctness are language dependent.
- Variant decrease plus a lower bound guarantees termination, not necessarily reaching zero.

### The Science of Programming — A Practical Python Playbook

- Executable specifications need not be decidable Python predicates; mathematical specifications are legitimate.
- Property tests and runtime invariant assertions test sampled executions, not universal proofs.
- Add finite/nonnegative weight checks and definition of weighted percentile; incomplete helper functions must be labelled.
- Bounded pagination calls do not guarantee wall-clock bounds or externally transactional exactly-once delivery.
- A for-loop index does not always exist after an empty loop; do not rely on its final value.
- Reduce categorical rhetoric about all bugs mapping uniquely to one proof check.

### Automata Theory — DFA, NFA & Regular Expressions

- Distinguish accepting absorbing state from nonaccepting dead/trap state.
- The suggested pumping-lemma string a^(p/2)b^(p/2) is inconvenient, not universally an invalid witness; handle odd p and cross-boundary cases correctly.
- State machine memory needs ceil(log2|Q|) storage bits; cardinality log2 is information capacity.
- Finite automata count modulo a fixed integer; they cannot enforce arbitrary exact equal counts.
- Remove absolute claims about every lexer and unverified executed-code claims.

### Context-Free Grammars & Pushdown Automata

- A bounded terminal length does not terminate a general CFG generator with epsilon/unit cycles.
- Clarify bounded PDA search may be inconclusive; it is not a total general membership decider via unbounded simulation.
- CYK space is O(n²|V|), O(n²) only for fixed grammar; use matrix-multiplication exponent ω rather than a stale numeric exponent.
- LL(1) needs disjoint predictive sets including FOLLOW for nullable alternatives; LR conflicts can indicate a non-LR grammar even when unambiguous.
- Complementing a DPDA needs normalization/end-of-input handling, not a naive final-state flip.
- Describe XML nesting over a fixed tag alphabet, not all semantic constraints of entire XML; HTML's procedural parser does not itself prove a language-class statement.
- An LBA suffices for a^n b^n c^n; one stack can handle several nested kinds, not just one scalar count.

### P vs NP & NP-Completeness

- EXPTIME-completeness does not prove a problem is outside NP: NP vs EXPTIME is open.
- Specify factoring's decision variant; factoring itself is a function problem.
- Natural-proofs barrier requires quantitative pseudorandom-function hardness, not simply existence of one-way functions.
- Haken's pigeonhole lower bound parameter is number of pigeons/holes, not the formula's variable count.
- MAX-3SAT 7/8 guarantees assume three distinct literals/variables per clause; general TSP has no constant-factor approximation, not literally no approximation whatsoever.
- Proof-length bounded provability is in NP when the bound is unary or polynomial in input length.
- Remove hard-coded machine timing claims and categorical statements that NP-complete instances cannot admit practical exact methods.

### Turing Machines & Undecidability

- Bounded simulation must return an inconclusive timeout, not nonhalting/rejection.
- A RAM-size cycle argument assumes a closed deterministic finite-state system and must include all configurations.
- Clarify soundness/completeness convention for bug detection vs safety verification.
- Busy Beaver is a function, not a decision language; do not classify its value as RE/co-RE in a language table.
- Keep Busy Beaver claims dated and distinguish known lower bounds from proved exact values.
- Qualify Gödel statements by effective axiomatization, sufficient arithmetic, and the stronger soundness assumption used by the displayed proof sketch.

### Entropy & Shannon's Source Coding Theorem

- The strict H≤L<H+1 symbol-code bound needs positive-probability alphabet assumptions and special handling of deterministic/single-symbol sources and known message length.
- Arithmetic coding length bounds use -log P(message) per message; nH+overhead is an expected bound, not a pointwise bound.
- Jensen's support calculation counts positive-probability outcomes, not declared zero-probability symbols.
- Nonuniform distributions can still have optimal fixed-length symbol codes; skew does not always allow a better symbol code.
- Empirical held-out cross-entropy is not automatically an upper bound on population entropy; distinguish expectation and finite samples.
- I(X;X)=H(X) is self mutual information, not the definition of self-information.
- Clarify ASCII 7-bit code vs typical 8-bit byte storage and differentiate CABAC from AV1 entropy coding.

### KL Divergence, Cross-Entropy & Machine Learning

- Forward mode covering/reverse mode seeking are heuristics for restricted model families, not universal laws.
- Real-valued softmax is positive for finite logits; floating-point softmax can underflow to exact zero.
- The empirical-distribution KL/MLE equivalence shown is discrete; atomic empirical measures vs continuous-density models have infinite measure KL.
- Classifier cross-entropy's population floor is conditional entropy H(Y|X), not necessarily marginal H(Y); one-hot targets can have zero entropy.
- Gradient softmax−target assumes natural logs and appropriate sum/mean scaling; base-2 gradients have a 1/ln2 factor.
- GAN/JS equivalence assumes an optimized discriminator and the original minimax objective; practical alternatives differ.
- Distillation's T² compensation is a large-temperature approximation, not exact for all T.
- Require equal-length normalized distributions; return infinity for support mismatch rather than blindly clipping genuine zeros.

### Channel Capacity & Error-Correcting Codes

- State the DMC assumptions and source/channel-use ratio in separation, rather than H<C without unit matching.
- Some channels support finite zero-error codes; the claim that every finite code has errors is false.
- Hard-decision loss is channel/rate dependent, not universally 2 dB.
- An unkeyed hash alone does not authenticate attacker-controlled data; use a MAC, signature, or trusted reference hash.
- The Reed–Solomon interpolation example handles erasures, not unknown error locations; label the distinction.
- Hamming(7,4) alone cannot simultaneously correct one and reliably detect two; distinguish SECDED and failures beyond guarantees.
- Use correct linear vs dB units for Eb/N0 and qualify asymptotic Gilbert–Varshamov/positive-rate statements.

### Compression in Practice — Arithmetic Coding, LZ & Beyond

- Compressing twice can sometimes help; never helps contradicts lossless JPEG recompression and is false.
- A compressor that shrinks an n-bit input need not enlarge another input of the same length; enlargement may occur at another length.
- JPEG also loses information in chroma subsampling and finite-precision steps, not only coefficient quantization.
- LZ universality is an asymptotic theorem with growing resource/source assumptions; fixed-window practical coders do not satisfy a universal guarantee.
- Distinguish ideal arithmetic-coding termination bounds, pending bits, model/length metadata, and finite-precision implementation overhead.
- Gaussian rate-distortion is zero for D≥variance, infinite at D=0; code must not report negative required rates.
- Avoid universal BWT-vs-LZ benchmark rankings; actual corpus/codec settings/version determine results.
- Differentiate CABAC used by H.264/HEVC from AV1 multi-symbol range coding.

### Kolmogorov Complexity — The Information in One Object

- Plain C has |x|+O(1) upper bound; prefix K needs a self-delimiting length term. Several recaps mix these conventions.
- The K-to-halting proof must restrict its oracle-enumerated set to strings of a fixed length; unbounded enumeration of all low-K strings is not an effective finite search.
- Finite random samples are incompressible with a quantified high probability, not literally almost surely.
- Information-distance universality requires admissibility/density restrictions, not every computable metric.
- NCD from real compressors may be negative or exceed 1 even using a single compressor; it is a heuristic, not an exact metric or guaranteed K bound in raw bytes.
- Compression length gives a description-length upper bound only with decoder and framing constants and consistent bit units.
- Chaitin/ZFC thresholds and number of Ω bits needed for famous conjectures depend on the fixed universal machine; remove unjustified numeric constants.
- Solomonoff semimeasure sums use minimal input prefixes; finite cumulative loss does not supply a universal fast convergence rate.
- Do not present genome sophistication/depth as measured or proven values; they are illustrative hypotheses.

### Lambda Calculus — Computation from Functions Alone

- Distinguish variable occurrences that are bound/free; same name may occur in both roles.
- η-equivalence in pure calculus is not an unrestricted operational equivalence in eager Python with effects.
- Valid finite Church-data folds terminate when their handlers terminate; arbitrary untyped terms can diverge.
- State normal-order reduction budget exhaustion is inconclusive, not proof of divergence.
- Church encodings and parser/reducer helpers need a complete downloadable implementation, not references to an absent test file.
- Hindley–Milner/Algorithm W claims apply to the specified language and let-polymorphism; Rust/TypeScript only share related ideas.

### Randomized Algorithms — Probability as a Tool

- The one-sided amplification exercise combines answers in the wrong direction: if errors occur only on yes instances, accept if any run accepts.
- Chebyshev itself needs finite variance, not independence; pairwise independence is only needed to add component variances simply.
- Karger's success/counting theorem assumes a connected graph with positive minimum cut; disconnected graphs can have exponentially many zero cuts.
- Fixed-base verified Rabin–Karp is deterministic and can take O(nm), including many true matches; verification alone does not make it Las Vegas.
- Python hashes of str/bytes are randomized; integer hashes are not randomized by PYTHONHASHSEED.
- Five-wise independence is sufficient for the stated linear-probing bound, not universally necessary for every hash family.
- Randomized class tables are decision classes; approximate counting is a function task with restrictions.
- Distinguish deterministic bounded-64-bit Miller–Rabin witness guarantees from randomized 4^-k guarantees.

### Monads in Python — With the Math

- A generator-based do helper using one mutable generator is unsafe for reusable Reader/State computations and branching List; limit the claim to one-shot linear use or recreate the generator.
- State's bind threads updated state; it is not a naive composition of Reader and Writer.
- Fixed applicative structure alone does not make effectful operations safe to parallelize.
- Accumulating Validation differs from the fail-fast Applicative induced by Result's monadic bind.
- Monad/category laws assume the chosen equality and pure/total function model; sampled law tests do not prove laws universally.
- Provide distinct Some(None) and absence so context and payload are not conflated.

### PyTorch 101 — From Tensors to Training

- PyTorch cross_entropy accepts float probability targets with matching class dimensions; one-hot targets are not categorically invalid.
- SDPA can dispatch to a math backend that materializes attention; optimized kernels are conditional. Functional SDPA dropout is not disabled by model.eval alone.
- LayerNorm's affine transform and epsilon mean final output is not exactly mean-zero/unit-variance.
- torch.chunk can return uneven or fewer chunks; transpose may require a compatible reshape, not always a copy.
- Gradient accumulation equals a large batch only with correct loss weighting and no batch-dependent behavior such as BatchNorm.
- state_dict compatibility requires tensor shapes and architecture, not only names; resuming training also needs optimizer/scheduler/RNG state.
- GGUF/Ollama conversion requires supported architectures/tokenizers; arbitrary .pt models and arbitrary GGUF files are not supported.
- Remove dependency on missing tiny_llm/ companion project, instantaneous mmap and unverifiable hardware timing claims.
- GELU is not universal for modern LLMs: Llama uses SiLU/SwiGLU.

### How LLMs Work — A Tech Talk

- Unmasked content-only self-attention is permutation-equivariant, not invariant; causal masks themselves restrict permutation symmetry.
- Every chatbot is decoder-only is false; proprietary architectures should not be inferred.
- Special-token reservation does not universally prevent user injection; policy and trusted conversation serialization matter.
- Residual width is d, but attention heads and FFN intermediates have other widths; GQA K/V projections are not all d×d.
- Learned positional tables fail beyond their allocated length rather than providing random vectors automatically.
- Attention heads can represent multiple patterns; specialization is a possible observation, not one fixed relationship per head.
- Incremental decoding computes new Q,K,V; KV persistence and conversation storage are runtime decisions, not universal statelessness claims.
- RLHF/SFT can change capabilities and knowledge; they do not only alter tone/style.
- Most agents use structured tool outputs and runtime dispatch; tools/memory are not necessarily JSON in a system prompt or always extra text.
- Mark token splits, vector arithmetic, and architecture-specific costs as examples with assumptions.

### Python 101 — Basics for a New Bee

- Tuple containers are immutable but may hold mutable elements; a tuple is hashable only if every element is hashable.
- Dictionary keys need stable hashing/equality, not universal immutability; mutable identity-hashed custom objects can be keys.
- Not every mutating method returns None: pop and setdefault are counterexamples.
- Dict/set lookups are expected/amortized O(1), with collision and key-cost caveats.
- For built-in integer operands / produces float; do not generalize to complex numbers or user-defined types.
- 4-space indentation and 88-character lines are style choices; PEP 8 recommends 79 code columns, while common formatters default to 88.
- Triple-quoted strings are parsed string expressions, not comments; range is a lazy sequence rather than a generator.
- Use zip(strict=True) when unequal lengths would indicate a bug; default zip truncates.

### Neural Networks and CNNs — From First Principles

- A neuron computes a weighted sum, not a weighted average; linear models can learn without nonlinear activations.
- Return raw logits for CrossEntropyLoss; float probability/one-hot targets can be valid.
- Flattening preserves information but removes an architectural spatial prior; dense networks can learn spatial patterns.
- Exact translation equivariance requires boundary/stride assumptions. Pooling/global averaging do not universally guarantee shift invariance.
- Convolution gradients sum spatial contributions into one update; positions are not independent optimizer updates.
- For a default valid 3x3 convolution, 32-to-512 input growth gives 30-to-510 outputs and 289x MACs, not 256x.
- Receptive-field recurrence needs the dilated effective kernel; stacks of small kernels are not universally better and large ConvNeXt kernels remain common.
- A transposed convolution is an adjoint, not an inverse. Resize-then-conv has different expressivity and does not guarantee artifact-free outputs.
- Skip connections improve optimization but do not mathematically prevent gradient cancellation or ensure deeper training cannot hurt.
- LayerNorm averages specified dimensions; ConvNeXt typically normalizes channels at each position. BatchNorm batch-size-one errors depend on values per channel.
- Mixed precision is not lossless; memory-format, optimizer, BatchNorm fusion, accuracy and throughput claims require measured context.
- 1x1 convolutions can be compute bound; GPU utilization below 100% does not uniquely imply a data-loading problem.
- Preserve dated architecture comparisons while removing universal modern CNN-vs-ViT rankings and unsupported accuracy predictions.

### Physics-Informed Neural Networks

- Keep the existing validated numerical result and full tutorial, but strengthen the training boundary with finite gradient/parameter checks.
- Include the PINN example in the collection-wide runner and student coding catalogue.
- Keep ordinary inference and derivative-based residual evaluation separate, including no_grad behavior.
- Ensure copied or downloaded standalone examples and declared dependencies match the deck.

## Files and recovery

- `before-review.zip` is the original presentation snapshot, created before edits.
- `verification.json` records check counts and actual program output.
- `lesson_plan.json` records each lesson's question, terms, trace, and exercise.
- `../examples/` contains runnable source and setup instructions.
- `../tools/upgrade_presentations.py` emits regenerated HTML/patches from the snapshot plus the correction data; it does not write files.

The snapshot is recoverable; no original presentation was deleted. Rebuilding the student revisions requires `beautifulsoup4` from `../tools/requirements.txt`.
