RFC: Induction should (like cases) allow non-variable targets
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Proposal
Reasoning about e.g. Big-Step Semantics needs induction over a Predicate containing a tuple.
Cases works nicely with this, however induction doesn't, and sometimes one really needs the induction hypothesis:
def State : Type :=
String → Nat
inductive Stmt : Type where
| skip : Stmt
| seq : Stmt → Stmt → Stmt
infixr:90 "; " => Stmt.seq
inductive BigStep : Stmt × State → State → Prop where
| skip (s) :
BigStep (Stmt.skip, s) s
| seq (S T s t u) (hS : BigStep (S, s) t)
(hT : BigStep (T, t) u) :
BigStep (S; T, s) u
infix:110 " ⟹ " => BigStep
theorem BigStep_deterministic {S s l r} (hl : (S,s) ⟹ l)
(hr : (S,s) ⟹ r) :
l = r :=
by
induction hl --fails, but cases is not enough here (for the 2nd goal)
The only workaround i know for this, is to express everything in terms of a tuple Ss.
Impact
Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failing induction hl example and compare it with cases. The payload names no source file or test; trace the induction elaboration path and define done as making the theorem work with a non-variable target while preserving existing cases behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100