Project 52: Real Analysis Foundations Lab

A self-contained deep-dive from the canonical Math from Foundations to Machine Learning curriculum.

  • Difficulty: Level 4: Expert
  • Time: 2 weeks
  • Language: Python
  • Prerequisites: Projects 6, 26, and 29-30
  • Source: foundations portion of ML-Math P27

What You Will Build

Create a counterexample-driven numerical lab for limits, continuity, completeness intuition, compact domains, and pointwise versus uniform convergence of function sequences. A function-family runner samples domains, refines adaptively near suspicious regions, compares pointwise trajectories with supremum error, and records the exact domain and norm behind every claim. Include canonical examples such as x^n on [0,1], moving spikes, continuous approximations to discontinuous limits, and families whose behavior changes when an endpoint is removed.

Real World Outcome

For a selected family, the lab plots several functions, pointwise errors, estimated supremum error versus index, and refinement locations. It produces a report such as “pointwise convergence passes on sampled points; uniform convergence fails because worst-case error remains one near the endpoint,” with an explicit counterexample witness.

Core Question

What kind of convergence or continuity are you claiming, on which domain, and what guarantee actually follows?

Concepts You Must Understand First

  • Epsilon definitions of sequence/function limits and continuity — Stephen Abbott, Understanding Analysis.
  • Pointwise versus uniform convergence and the supremum norm.
  • Compactness, completeness, Cauchy sequences, and why domain assumptions matter.
  • Lipschitz continuity and sensitivity bounds.
  • Counterexamples as tests of overgeneralized conjectures.

Build Milestones

  1. Implement a function-family/domain interface and pointwise trajectory explorer.
  2. Estimate supremum error and add adaptive refinement around peaks, endpoints, and discontinuities.
  3. Reproduce at least four examples separating pointwise and uniform behavior.
  4. Add continuity/Lipschitz diagnostics and experiments that alter domain assumptions.
  5. Generate a report that states hypotheses, evidence, limitations, and a witness for failed claims.

Hints in Layers

  1. A finite grid cannot prove a universal statement; frame results as diagnostics backed by theory.
  2. For x^n, sample increasingly close to one or optimize the error instead of trusting a fixed grid.
  3. Always display the norm and domain beside an error curve.

Common Pitfalls and Debugging

  • Lab incorrectly reports uniform convergence: coarse sampling misses a narrowing boundary region. Add adaptive refinement and a known analytic witness.
  • Changing the grid changes the conclusion: the numerical claim lacks stability. Report grid-sensitivity and avoid labeling it proof.
  • Average error is small but worst case is large: mean error was substituted for supremum error. Compute and visualize both.

Definition of Done

  • At least four function families include known limits and domain assumptions.
  • Two pointwise-but-not-uniform examples are correctly diagnosed.
  • Supremum estimates are tested against grid refinement or analytic values.
  • Compactness/endpoint changes produce an explained change in behavior.
  • Every report distinguishes numerical evidence from mathematical proof.
  • A final note records at least one misconception corrected by a counterexample.

Previous: Project 51 · Complete learning path · Next: Project 53