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

unseal コマンド使用例:decidable なのに decide で示せない例

Open
#611 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

import Mathlib

example : Nat.log2 4 = 2 := by 
  -- decide で示すことができない
  fail_if_success decide
  
  simp [Nat.log2]

-- これは通るので Decidable のインスタンスではある
-- なぜ上記の命題を decide で示せないのかというと、
-- reducible ではないから。
#eval decide (Nat.log2 4 = 2)

-- unseal すると decide で示せるようになる
unseal Nat.log2 in

example : Nat.log2 4 = 2 := by  
  decide

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

No file or test is named. Start by locating where this repository keeps Lean examples, then review the unseal, decide, and Nat.log2 snippet from the issue. Done means the example clearly shows why decide fails before unsealing and succeeds afterward.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.