labs / lab-c-mathematics--constructive-vs-nonconstructive-proofs
Next task →
Practical Labs/Lab: Constructive vs nonconstructive proofs
Level 2 · mathematics

Lab: Constructive vs nonconstructive proofs

Build a minimal, verifiable implementation that demonstrates Constructive vs nonconstructive proofs. Connect the code to the governing equation, inspect its output numerically, and explain one failure case.

Mathematical basis

For Constructive vs nonconstructive proofs, write the defining identity and prove the bound ∣f(x)−f(a)∣<ε|f(x)-f(a)|<\varepsilon whenever ∣x−a∣<δ|x-a|<\delta.

Instructions

  1. 01Read section 7 of the Constructive vs nonconstructive proofs learning page and write its governing equation on paper.
  2. 02Implement the core operation in SymPy/NumPy on synthetic matrices and scalar functions. Do not call a library function that solves the whole task.
  3. 03Verify the implementation on a hand-computed three-element or 3×3 example before scaling up.
  4. 04Run the experiment with the tolerance ε and record maximum residual.
  5. 05Inspect the output, identify one discrepancy with the theory, and write a one-paragraph explanation.

Starter code

import numpy as np

def demonstrate(x, tol=1e-9):
    """Numerical check for Constructive vs nonconstructive proofs."""
    x = np.asarray(x, float)
    assert x.size > 0
    return np.sum(x), np.max(np.abs(x))

s, m = demonstrate([1.0, 2.0, 3.0])
assert abs(s - 6.0) < 1e-12 and m == 3.0
print(s, m)