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

%記法のデラボレータ Delab使用例

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

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.