ユニバースレベルの等価性判定が改善された(max と imax)

Open Beginner friendly
#2,676 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Domain
documentation

Research direction

Read LeanByExample/Declarative/Universe.lean and compare its existing discussion of Sort and universe levels with the upstream regression example in lean4/tests/elab/levelEquiv.lean. Once the project supports the updated Lean behavior, add an explanation and example showing that these differently written levels are equal by rfl; done when the chapter documents this case accurately.

Written by the indexing model from the issue text.

Description

Lean の master に入った lean4#15198 で、従来の判定で一致しなかった場合に、カーネルとエラボレータがユニバースレベルの等価性を別のアルゴリズムで判定するようになりました。

上流の回帰テスト から、短い例です。

universe u v
example : Sort (max u (imax u v)) = Sort (max u v) := rfl

v = 0 なら両辺のレベルは u で、v > 0 なら imax u v = max u v なので、やはり両辺のレベルは等しくなります。違う式で書いてあっても、同じレベルを表していれば型の変換を挟まず rfl で示せる、という例です。任意のユニバースメタ変数の制約が解けるようになった、という変更ではありません。

同じコードを Lean v4.37.0-rc1 と nightly-2026-12-02 で実行すると Type mismatch、修正入りの nightly-2026-12-03 では成功しました。上流コミットは 04155dc です。

対応版に更新したら、universe 章 で Sort とレベルの話に続けて紹介できそうです。

Dominant language
Lean
Stars
200
Forks
17
Avg merge
20m
Merged PRs (30d)
6

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from lean-ja/lean-by-example

All issues in lean-ja/lean-by-example

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.