leanprover / leanprover/lean4

(kernel) application type mismatch in `cbv` with `ite_true`

Open
#15,182 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Description

In Lean v4.35.0-rc1, this cbv:

example :
    (if True then some 2 else none) = some 2 := by
  cbv

triggers the following error:

(kernel) application type mismatch
  ite_true
argument has type
  Option Nat
but function has type
  ∀ {x : Decidable True} (a b : Option Nat), (if True then a else b) = a
Steps to Reproduce

Here is a live.lean-lang.org link:
https://live.lean-lang.org/#codez=KYDwhgtgDgNsAEAuAUPN8AUBLAZvAKgE4CuCALgBbAB28AzgPYQIBM8wMdC1D1wAlPAC89JqyQiARgE9U8AMaSAbkA

Versions

This fails on lean version v4.35.0-rc1, and has no errors in lean version v4.34.0

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the live.lean-lang.org reproduction and compare behavior between Lean v4.35.0-rc1 and v4.34.0. Trace the cbv handling of the ite_true reduction and its kernel application type checking; done means the example elaborates and reduces without the reported mismatch while preserving the older behavior.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.