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

STを使ってFalseを示す例

Open
#2,442 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

If you're curious, here's a proof of False using ST.Ref.get:

```lean4
def test : ST ω Nat := fun s =>
  let ⟨ref, s₁⟩ := ST.Prim.mkRef 0 s
  let ⟨n, _⟩ := ST.Prim.Ref.get ref s₁
  let ⟨(), s₃⟩ := ST.Prim.Ref.set ref 1 s₁
  ⟨n, s₃⟩

def test2 : ST ω Nat := fun s =>
  let ⟨ref, s₁⟩ := ST.Prim.mkRef 0 s
  let ⟨(), s₃⟩ := ST.Prim.Ref.set ref 1 s₁
  let ⟨n, _⟩ := ST.Prim.Ref.get ref s₁
  ⟨n, s₃⟩

example : False := by
  have : (test (Void.mk ())).1 = 0 := by native_decide
  have : (test2 (Void.mk ())).1 = 1 := by native_decide
  have : @test = @test2 := rfl
  simp_all
```

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 code block with ST.Prim.mkRef, ST.Prim.Ref.get, ST.Prim.Ref.set, and native_decide in the repository's example environment. Check whether the claimed definitional equality between test and test2 is valid and identify what the example demonstrates. Done means the reported contradiction is explained and the affected example or documentation is resolved.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.