بنقرة واحدة
gpd-limiting-cases
Systematically identify and verify all relevant limiting cases for a result or phase
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Systematically identify and verify all relevant limiting cases for a result or phase
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Add research phase to end of current milestone in roadmap
Capture idea or task as todo from current research conversation context
Prepare a paper for arXiv submission with validation and packaging
Audit research milestone completion against original research goals
Create a hypothesis branch for parallel investigation of an alternative approach
List pending research todos and select one to work on
استنادا إلى تصنيف SOC المهني
| name | gpd-limiting-cases |
| description | Systematically identify and verify all relevant limiting cases for a result or phase |
| argument-hint | [phase number or file path] |
| context_mode | project-aware |
| allowed-tools | ["read_file","write_file","shell","grep","glob","ask_user"] |
<codex_runtime_notes> Codex shell compatibility:
gpd on PATH.GPD_ACTIVE_RUNTIME=codex uv run gpd ....
</codex_runtime_notes><codex_questioning>
Why a dedicated command: Checking limiting cases ad hoc misses limits. A systematic audit ensures every physically meaningful limit is checked. When a result fails a known limit, the error is localized: something in the derivation breaks in that regime, which dramatically narrows the search space for debugging.
The principle: Every new result must reduce to known results in appropriate limits. If it doesn't, the new result is wrong (or the known result is wrong, which is rare but possible). There are no exceptions to this principle.
Target: $ARGUMENTSInterpretation:
Load known framework:
cat .gpd/research-map/FORMALISM.md 2>/dev/null | grep -A 20 "Known Limiting Cases"
cat .gpd/research-map/VALIDATION.md 2>/dev/null | grep -A 30 "Limiting Cases"
<execution_context>
Systematically identify all relevant limiting cases for a physics result and verify that each limit is correctly recovered. This is the single most powerful verification tool in theoretical physics.Called from $gpd-limiting-cases command. Produces LIMITING-CASES.md report.
Every new result must reduce to known results in appropriate limits. If it doesn't, the new result is wrong (or the known result is wrong, which is rare but possible). There are no exceptions to this principle.
Load project state and conventions to identify applicable limits:
INIT=$(/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local init phase-op --include state,config)
if [ $? -ne 0 ]; then
echo "ERROR: gpd initialization failed: $INIT"
# STOP — display the error to the user and do not proceed.
fi
state_exists: true): Extract convention_lock for unit system and sign conventions. Extract intermediate_results from state for previously verified expressions. Extract active approximations and their validity ranges — these define the limits to check.state_exists is false (standalone usage): Proceed with explicit convention declarations required from user via ask_user.Active approximations from the project state directly inform which limits are most important to verify (e.g., if a perturbative approximation is active, the free-theory limit g→0 is mandatory).
Convention verification (if project exists):
CONV_CHECK=$(/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local --raw convention check 2>/dev/null)
if [ $? -ne 0 ]; then
echo "WARNING: Convention verification failed — review before checking limits"
echo "$CONV_CHECK"
fi
Limiting case checks depend on conventions — e.g., the sign of k^2 = m^2 vs k^2 = -m^2 in the non-relativistic limit depends on metric signature.
Scan the target for the main physics results:
# Final expressions, key results
grep -n "result\|final\|=.*\\\\frac\|=.*\\\\sqrt\|=.*\\\\sum\|=.*\\\\int\|E\s*=\|Z\s*=\|sigma\s*=\|Gamma\s*=" "$TARGET_FILE" 2>/dev/null
# Named equations
grep -n "\\\\label\|\\\\tag\|# Eq\." "$TARGET_FILE" 2>/dev/null
For each result, identify:
For each result, systematically enumerate limits organized by physics domain:
| Limit | Parameter | Expected Behavior |
|---|---|---|
| Free theory | coupling g -> 0 | Reduce to non-interacting result |
| Classical | hbar -> 0 | Reduce to classical expression |
| Static | omega -> 0 or v -> 0 | Reduce to time-independent result |
| Single particle | N -> 1 | Reduce to one-body problem |
| Limit | Parameter | Expected Behavior |
|---|---|---|
| High temperature | T -> infinity (beta -> 0) | Classical equipartition |
| Low temperature | T -> 0 (beta -> infinity) | Ground state dominance |
| Thermodynamic | N -> infinity, V -> infinity, N/V fixed | Intensive quantities well-defined |
| Ideal gas | interactions -> 0 | PV = NkT or quantum ideal gas |
| Dilute | density -> 0 | Ideal gas behavior |
| Limit | Parameter | Expected Behavior |
|---|---|---|
| Non-relativistic | v/c -> 0 or E << mc^2 | Schrodinger equation |
| Semiclassical | large quantum numbers | Correspondence principle |
| Weak field | perturbation -> 0 | Unperturbed result + linear correction |
| Strong field | perturbation -> infinity | Known strong-coupling result (if exists) |
| Harmonic | anharmonicity -> 0 | Equally spaced levels |
| Limit | Parameter | Expected Behavior |
|---|---|---|
| Tree level | hbar -> 0 or g -> 0 | Classical field theory |
| Free field | all couplings -> 0 | Free propagators, no scattering |
| Non-relativistic | p << mc | Schrodinger field theory |
| Low energy | E << Lambda | Effective field theory |
| Large N | N -> infinity | Saddle point / mean field |
| Abelian | gauge group -> U(1) | QED-like result |
| Limit | Parameter | Expected Behavior |
|---|---|---|
| Continuum | lattice spacing a -> 0 | Continuum field theory |
| Single-site | hopping -> 0 | Atomic limit |
| Mean-field | d -> infinity | Saddle point exact |
| Non-interacting | U -> 0 | Band structure |
| Half-filling | n = 1 | Particle-hole symmetry |
| Limit | Parameter | Expected Behavior |
|---|---|---|
| Newtonian | weak field, slow motion | Newton's gravity |
| Flat spacetime | G -> 0 | Special relativity |
| Non-relativistic | v << c | Galilean invariance |
| Schwarzschild | spherical symmetry | Known exact solution |
| Cosmological | large scales | FRW metric |
| Limit | Parameter | Expected Behavior |
|---|---|---|
| 1D | d = 1 | Often exactly solvable |
| 2D | d = 2 | Special features (BKT, conformal symmetry) |
| Large distance | r -> infinity | Asymptotic behavior (decay, scattering) |
| Short distance | r -> 0 | UV behavior, contact terms |
| Infinite volume | L -> infinity | No finite-size effects |
Not all limits apply to every result. Select based on:
Present the selected limits:
## Limiting Cases for {Result Name}
Selected {N} applicable limits:
| # | Limit | Parameter | Known Result | Source |
|---|-------|-----------|--------------|--------|
| 1 | {limit} | {param -> value} | {known expression} | {textbook/paper} |
| 2 | ... | ... | ... | ... |
Ask the user once using a single compact prompt block if:
For each selected limit:
# Template for numerical limit check
import numpy as np
def result_function(params):
"""The result being checked."""
...
def known_limit(params):
"""The known limiting expression."""
...
# Approach the limit systematically
param_values = [1.0, 0.1, 0.01, 0.001, 0.0001]
for val in param_values:
computed = result_function({..., limit_param: val})
expected = known_limit({..., limit_param: val})
ratio = computed / expected
rel_error = abs(computed - expected) / abs(expected)
print(f"param={val:.0e} computed={computed:.10f} expected={expected:.10f} ratio={ratio:.10f} rel_err={rel_error:.2e}")
# Expected: ratio -> 1 and rel_error -> 0 as param -> limiting value
# Red flags: ratio not approaching 1, oscillating, or diverging
| Status | Meaning |
|---|---|
| EXACT MATCH | Analytical limit reproduces known result identically |
| NUMERICAL MATCH | Converges to known result within numerical precision |
| CORRECT ORDER | Leading term matches; subleading terms expected to differ |
| DISCREPANCY | Does not match -- error in derivation or in known result identification |
| DIVERGENT | Limit does not exist (may be physical or may indicate error) |
| CANNOT CHECK | Limit is intractable analytically and numerically |
For any limit that fails:
Characterize the discrepancy:
Localize the error:
Suggest cause:
Write LIMITING-CASES.md:
---
target: { phase or file }
date: { YYYY-MM-DD }
results_checked: { N }
limits_checked: { M }
limits_passed: { K }
limits_failed: { F }
status: all_passed | failures_found
---
# Limiting Cases Report
## Results Analyzed
| # | Result | Expression | Location |
| --- | ------ | ------------ | ----------- |
| 1 | {name} | {brief form} | {file:line} |
## Limits Verified
| # | Result | Limit | Parameter | Expected | Obtained | Status |
| --- | -------- | ------------ | ---------------- | -------- | ---------- | ----------- |
| 1 | {result} | {limit name} | {param -> value} | {known} | {computed} | MATCH |
| 2 | {result} | {limit name} | {param -> value} | {known} | {computed} | DISCREPANCY |
## Failed Limits
### Failure {N}: {Result} in {Limit}
- **Parameter:** {param -> value}
- **Expected:** {expression from known result}
- **Obtained:** {expression from our result in this limit}
- **Discrepancy:** {factor of 2, wrong sign, wrong power, etc.}
- **Likely cause:** {what went wrong}
- **Location of error:** {where in the derivation the limit first fails}
## Summary
- Results checked: {N}
- Total limits applicable: {M}
- Passed: {K}
- Failed: {F}
- Cannot check: {C}
- {Overall assessment}
Many physics limits are singular: the result is qualitatively different depending on the order in which limits are taken, or the limiting expression is distributional rather than pointwise convergent. These require special treatment.
When two parameters approach limits simultaneously, the order matters. The result can change qualitatively.
Protocol:
Common non-commuting limits:
When the limiting expression involves delta functions or other distributions, pointwise comparison is meaningless.
Protocol:
Examples:
Asymptotic expansions can change form discontinuously as the direction of approach in the complex plane varies.
Protocol:
Common contexts:
The limit N → ∞, V → ∞ with N/V fixed introduces subtleties that can invalidate naive interchange of limits with differentiation or integration.
Protocol:
Ensure output directory exists:
mkdir -p .gpd/analysis
Save to:
${phase_dir}/LIMITING-CASES.md.gpd/analysis/limits-{slug}.mdIf all pass:
## Limiting Cases: All {M} limits verified
{Result} correctly reduces to known expressions in all checked limits.
Confidence: HIGH
If failures found:
## Limiting Cases: {F}/{M} limits failed
{List failures with discrepancy character}
Suggested next steps:
- `$gpd-debug` -- investigate the failing limit(s)
- `$gpd-dimensional-analysis` -- check for dimensional errors near the failure
- Review derivation at {location} where the limit first diverges from expectation
Commit the report:
PRE_CHECK=$(/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local pre-commit-check --files "${OUTPUT_PATH}" 2>&1) || true
echo "$PRE_CHECK"
/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local commit \
"docs: limiting cases verification — ${phase_slug:-standalone}" \
--files "${OUTPUT_PATH}"
Where ${OUTPUT_PATH} is the path where LIMITING-CASES.md was written.
<success_criteria>
</execution_context>
Pre-flight check:
CONTEXT=$(/Users/charlie/.gpd/venv/bin/python -m gpd.runtime_cli --runtime codex --config-dir ./.codex --install-scope local --raw validate command-context limiting-cases "$ARGUMENTS")
if [ $? -ne 0 ]; then
echo "$CONTEXT"
exit 1
fi
Follow the limiting-cases workflow: @./.codex/get-physics-done/workflows/limiting-cases.md
For comprehensive verification (dimensional analysis + limiting cases + symmetries + convergence), use $gpd-verify-work.
<success_criteria>