Check and verify mathematical proofs, find errors, validate reasoning. Use for: check this proof, is this correct, find the error, verify theorem, validate solution, proof review, logical gaps, counterexample, is my reasoning correct, what's wrong with this proof. Triggers: "check", "verify", "is this correct", "find the error", "what's wrong", "validate", "proof review", "counterexample", "is my proof right"
Critically examine proofs for correctness, find logical gaps, search for counterexamples.
Phase 1: STRUCTURAL ANALYSIS
- What technique? (direct, contradiction, induction, contrapositive)
- What are all premises?
- What is the conclusion?
- Map each step to its justification
Phase 2: STEP-BY-STEP VERIFICATION
For EACH step:
- What does it claim?
- What's the justification?
- Verify: computation? theorem? definition?
- Mark: VERIFIED / UNVERIFIED / INVALID
Phase 3: COUNTEREXAMPLE SEARCH
- Test boundary cases
- Test pathological examples
- Try to break the proof
Phase 4: VERDICT
- List all issues found
- Overall assessment with confidence
<pattern name="Check Algebraic Steps">
```python
from sympy import *
x = symbols('x')
</pattern>
<pattern name="Check Inequalities">
```python
from sympy import *
from sympy.solvers.inequalities import solve_univariate_inequality
</pattern>
<pattern name="Verify Theorem Hypotheses">
```python
# When proof cites a theorem, verify hypotheses are satisfied
</pattern>
claimed = (x+1)2 expanded = expand(claimed) expected = x2 + 2*x + 1
print(f"Claimed expansion: {expanded}") print(f"Expected: {expected}") print(f"Match: {simplify(expanded - expected) == 0}")
</pattern>
<pattern name="Check Limit Arguments">
```python
from sympy import *
x, n = symbols('x n')
# Verify limit claim: lim_{x->0} sin(x)/x = 1
result = limit(sin(x)/x, x, 0)
print(f"Computed limit: {result}")
print(f"Claimed limit matches: {result == 1}")
# Check L'Hopital applicability
numerator_at_0 = sin(x).subs(x, 0)
denominator_at_0 = x.subs(x, 0)
print(f"0/0 form: {numerator_at_0 == 0 and denominator_at_0 == 0}")
x = symbols('x', real=True)
inequality = x**2 - x >= 0 solution = solve_univariate_inequality(inequality, x, relational=False) print(f"x^2 - x >= 0 when: {solution}")
</pattern>
<pattern name="Test Edge Cases">
```python
import numpy as np
def test_claim(f, test_points, expected_behavior):
"""Test a claimed property at specific points."""
results = []
for x in test_points:
try:
y = f(x)
results.append((x, y, expected_behavior(x, y)))
except Exception as e:
results.append((x, "ERROR", str(e)))
return results
# Example: test claim that f(x) > 0 for all x > 0
f = lambda x: x**2 - x + 0.25 # (x - 0.5)^2
test_points = [0.001, 0.5, 1, 10, 1e-10]
for x in test_points:
print(f"f({x}) = {f(x)}, > 0: {f(x) > 0}")
from sympy import * x = symbols('x')
f = Abs(x) print(f"f = {f}") print(f"Continuous on [-1,1]? Yes (absolute value is continuous)") print(f"Differentiable at 0? No (corner point)") print("CONCLUSION: MVT does NOT apply here!")
</pattern>
<pattern name="Pathological Counterexamples">
```python
import numpy as np
# Weierstrass function: continuous but NOWHERE differentiable
def weierstrass(x, a=0.5, b=7, n_terms=50):
return sum(a**n * np.cos(b**n * np.pi * x) for n in range(n_terms))
# Test: if proof assumes "continuous => differentiable somewhere"
x_test = np.linspace(0, 1, 1000)
y_test = [weierstrass(x) for x in x_test]
print("Weierstrass function is continuous everywhere")
print("But differentiable NOWHERE - counterexample to naive assumption")
# Indicator function of rationals: discontinuous everywhere
# (useful for checking integrability claims)
| Error Type | What to Check | How to Catch |
|---|---|---|
| Quantifier swap | Is "for all x, exists y" confused with "exists y, for all x"? | Read carefully, test with specific examples |
| Division by zero | Could denominator be zero anywhere? | Substitute edge values |
| Hidden continuity | Is continuity assumed but not proven? | Check function at all points used |
| Boundary failure | Does proof work at endpoints? | Test a, b explicitly |
| Uniform vs pointwise | Are convergence types confused? | Check if bound depends on point |
| Circular reasoning | Is conclusion used in proof? | Trace logical dependencies |
| Off-by-one | Index errors in sums/products? | Compute first few terms manually |
## Claim Being Verified
[Exact statement of theorem/claim]
## Proof Structure
- Type: [direct/contradiction/induction/...]
- Key techniques: [...]
## Step-by-Step Verification
### Step 1: [description]
- **Claim**: [what this step asserts]
- **Justification**: [author's reasoning]
- **Verification**:
```python
# Computational check
[continue for each step]
| Case | Expected | Computed | Status |
|---|---|---|---|
| x=0 | ... | ... | OK/FAIL |
| x->oo | ... | ... | OK/FAIL |
VALID / VALID WITH MINOR ISSUES / INCOMPLETE / INVALID
Confidence: HIGH / MEDIUM / LOW Reason: [why this confidence level]