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

absurd タクティクを自作する

Open
#1,886 2 comments 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

The tactic could be a little more helpful than the absurd term and try both argument orders:

macro "absurd " e₁:term:arg e₂:term:arg : tactic =>
  `(tactic|
    first
      | exact absurd $e₁ $e₂
      | exact absurd $e₂ $e₁
      | fail "could not find absurdity"
  )

example (p : Prop) (h : p) (h' : ¬ p) : 1 = 2 := by
  absurd h h'

example (p : Prop) (h : p) (h' : ¬ p) : 1 = 2 := by
  absurd h' h

example (p q : Prop) (h : p) (h' : ¬ q) : 1 = 2 := by
  absurd h' h
  -- error: could not find absurdity

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 from the proposed absurd tactic macro in the issue and run the three Lean examples to verify both argument orders and the failure case. Done means the tactic accepts either order for contradictory hypotheses and reports "could not find absurdity" when the hypotheses do not contradict.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.