lean-ja / lean-ja/lean-by-example
absurd タクティクを自作する
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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