lean-ja / lean-ja/lean-by-example
%記法のデラボレータ Delab使用例
Open
Nobody has claimed this yet.
メタプログラミング
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
import Mathlib
notation n"%" => (n : Fin 101)
-- this is magic, ignore it
open Qq Lean PrettyPrinter Delaborator in
@[app_delab OfNat.ofNat]
def delabPercent : Delab := whenPPOption Lean.getPPNotation do
let #[α, n, _] := (← SubExpr.getExpr).getAppArgs | failure
let .true ← Meta.isDefEq α q(Fin 101) | failure
let some n := n.rawNatLit? | failure
`($(quote n)%)
example : 36% < 37% := by decide
example : ∀ x, 0% ≤ x ∧ x ≤ 100% := by decide
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
The issue contains a standalone Lean code snippet but names no file, test, or entry point. Clarify where the % notation and Delab example should be added and what documentation format is expected before implementing it.
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
- Needs clarification
- Newbie friendliness
- 30/100