lean-ja / lean-ja/lean-by-example

universe level が問題になる例: Prod

Open
#1,401 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

コード例
Dominant language
Lean
Stars
188
Forks
15
Avg merge
9h 8m
Merged PRs (30d)
6

Description

Prod を自作しようとしたところ、universe level 関連のエラーが出た。

inductive MyProd (α β : Type) : Type 1 where
  | mk (fst : α) (snd : β)

infix:20 " ×ₘ " => MyProd

#eval
  /-
  application type mismatch
    Nat ×ₘ (Int ×ₘ String)
  argument
    Int ×ₘ String
  has type
    Type 1 : Type 2
  but is expected to have type
    Type : Type 1
  -/
  let x : Nat ×ₘ (Int ×ₘ String) := ⟨1, ⟨2, "hello"⟩⟩

  let y : Nat ×ₘ (Int ×ₘ String) := ⟨1, 2, "hello"⟩
  x = y

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 by reproducing the self-contained Lean example in the issue and inspect the reported universe-level mismatch for the nested MyProd type. Determine whether the example should be corrected or documented, then verify that the intended product construction no longer produces the reported error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.