Commit c83e078
proof(SafePassword): DISCHARGE withMinLengthCorrect via nested constructor case-split (#143)
## Summary
Discharge \`Proven.SafePassword.Proofs.withMinLengthCorrect\` via double
constructor case-split.
The OWED comment correctly suggested case-split on \`b = MkPolicyBuilder
_\`. **Empirically verified** that DOUBLE case-split is needed — both
the outer \`MkPolicyBuilder\` AND the inner \`MkPolicy\` constructor
must be exposed for the projection \`({ minLength := n } p).minLength\`
to reduce.
## Discharge
\`\`\`idris
withMinLengthCorrect n (MkPolicyBuilder (MkPolicy _ _ _ _ _ _ _ _ _ _))
= Refl
\`\`\`
The 10 underscores correspond to PasswordPolicy's 10 fields
(\`minLength\` through \`forbiddenWords\`).
## Why double case-split
Tested at \`/tmp/charrefl/src/TestPolicyBuilder.idr\`:
- Single case-split on \`MkPolicyBuilder _\` alone: **fails** —
\`{minLength := n} p\` doesn't reduce through abstract \`p\`
- Double case-split exposing both constructors: **succeeds** — the
record-update + projection chain reduces fully
## Sister OWED not addressed
\`chainedBuildersCompose\` (Proofs.idr:430) is **NOT** discharged here.
It requires reducing \`Policy.policyBuilder\` (a top-level constant).
Same blocker family as SafeCSV's \`defaultDelimiterIsComma\` — top-level
\`public export\` constants don't reduce for downstream record
projection. Discharge waits for either an Idris2 0.8.0 fix or a
named-constant-bridge lemma technique.
## Verification
- \`idris2 --check src/Proven/SafePassword/Proofs.idr\` → Exit 0
- \`/tmp/charrefl/src/TestPolicyBuilder.idr\` prototype confirms double
case-split is necessary and sufficient
- Zero \`believe_me\` / \`postulate\` / \`idris_crash\`
Refs proven#90 (Phase 3 OWED triage), proven#107 (overly-cautious OWED
meta).
## Test plan
- [x] Local type-check clean
- [x] /tmp/charrefl test harness
- [ ] CI \`idris2 --check proven.ipkg\` green
- [ ] CI test suite green
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9f7fd41 commit c83e078
1 file changed
Lines changed: 12 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
414 | 414 | | |
415 | | - | |
416 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
0 commit comments