Skip to content

psi: keep a disjunction's type when an applied implication proof introduces it - #6314

Merged
Smotto merged 1 commit into
mainfrom
claude/project-thread-of3g1z
Nov 27, 2026
Merged

Smotto merged 1 commit into
mainfrom
claude/project-thread-of3g1z

Conversation

@Smotto

@Smotto Smotto commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Requested by Jarod · project thread

A theorem whose proof introduces a disjunction can now be cited. Before this change, citing

machine one_is_nonzero(n: u8)
requires n == 1u8
ensures n != 0u8
{
}

for data OneIsNonzero = machine(n: u8) requires n == 1u8 ensures n != 0u8; was refused with "complete theorem implication was refused by the mathematical kernel", although the theorem's own proof is accepted.

The cause is in the bounded elaborator, not the citation. n != 0 denotes the disjunction n < 0 ∨ 0 < n, a pair whose second component's type depends on its tag. The kernel infers an unannotated pair as a plain product. The citation applies the theorem's requires → ensures proof on the spot, so the kernel infers that lambda's body instead of checking it against the goal, and the inferred product differs from the denoted disjunction. A disjunction introduction now ascribes its pair the disjunction's type with (λ (x : ty). x) pair, which the kernel checks and then infers as ty. No rule is accepted that was refused before: the pair is still checked, now against its exact type.

Gate: RC-SOURCE-SEMANTICS | a disjunction introduced inside an applied implication proof keeps its type, so a theorem proved from an equality can be cited
Spec: wiki/spec/proofs/mathematical_bindings.md#logical-hypotheses-and-machine-use
Proof: mbx test -p proof-admission (new kernel positive a_disjunction_introduced_inside_an_applied_implication_keeps_its_type, which failed with a kernel type mismatch before the fix, and its negative twin with the wrong disjunct), mbx test -p source-compiler --features test-support --test checking_theorem_proof_parameters (32 passed: new positive a_theorem_proved_from_an_equality_supplies_the_alias and negative a_theorem_proved_from_another_equality_cannot_supply_the_alias), mbx test --no-fail-fast -p proof-admission -p terminal-semantics -p lowered-program-to-checked-program (all passed: 1553, 184, 77 and 332 tests), mbx xtask fmt --check --base origin/main | clean

Agent: Claude Code | Model: unavailable | Effort: medium | Tokens: unavailable | Steps: unavailable | Time: 0h40m | Steers: 0


Generated by Claude Code

…oduces it

The kernel infers an unannotated pair as a plain product, so a disjunction
introduced inside an implication proof that is applied on the spot lost its
tag-indexed family. Ascribe the pair its denoted disjunction type. This lets
a theorem proved from an equality, such as n == 1 => n != 0, be cited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HqP8t6ks5c3gBLeNZESrbf
@Smotto Smotto self-assigned this Nov 27, 2026
@Smotto
Smotto merged commit 63e1058 into main Nov 27, 2026
1 check passed
@Smotto
Smotto deleted the claude/project-thread-of3g1z branch November 27, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants