@@ -202,7 +202,7 @@ instance : MonadLift Option MetaM where
202
202
203
203
/-- The `norm_num` extension which identifies expressions of the form `a + b`,
204
204
such that `norm_num` successfully recognises both `a` and `b`. -/
205
- @[norm_num _ + _, Add.add _ _ ] def evalAdd : NormNumExt where eval {u α} e := do
205
+ @[norm_num _ + _] def evalAdd : NormNumExt where eval {u α} e := do
206
206
let .app (.app (f : Q($α → $α → $α)) (a : Q($α))) (b : Q($α)) ← whnfR e | failure
207
207
let ra ← derive a; let rb ← derive b
208
208
match ra, rb with
@@ -310,7 +310,7 @@ theorem isRat_sub {α} [Ring α] {f : α → α → α} {a b : α} {na nb nc :
310
310
311
311
/-- The `norm_num` extension which identifies expressions of the form `a - b` in a ring,
312
312
such that `norm_num` successfully recognises both `a` and `b`. -/
313
- @[norm_num _ - _, Sub.sub _ _ ] def evalSub : NormNumExt where eval {u α} e := do
313
+ @[norm_num _ - _] def evalSub : NormNumExt where eval {u α} e := do
314
314
let .app (.app (f : Q($α → $α → $α)) (a : Q($α))) (b : Q($α)) ← whnfR e | failure
315
315
let rα ← inferRing α
316
316
let ⟨(_f_eq : $f =Q HSub.hSub)⟩ ← withNewMCtxDepth <| assertDefEqQ _ _
@@ -380,7 +380,7 @@ theorem isRat_mul {α} [Ring α] {f : α → α → α} {a b : α} {na nb nc :
380
380
381
381
/-- The `norm_num` extension which identifies expressions of the form `a * b`,
382
382
such that `norm_num` successfully recognises both `a` and `b`. -/
383
- @[norm_num _ * _, Mul.mul _ _ ] def evalMul : NormNumExt where eval {u α} e := do
383
+ @[norm_num _ * _] def evalMul : NormNumExt where eval {u α} e := do
384
384
let .app (.app (f : Q($α → $α → $α)) (a : Q($α))) (b : Q($α)) ← whnfR e | failure
385
385
let sα ← inferSemiring α
386
386
let ra ← derive a; let rb ← derive b
@@ -433,7 +433,7 @@ def inferDivisionRing (α : Q(Type u)) : MetaM Q(DivisionRing $α) :=
433
433
434
434
/-- The `norm_num` extension which identifies expressions of the form `a / b`,
435
435
such that `norm_num` successfully recognises both `a` and `b`. -/
436
- @[norm_num _ / _, Div.div _ _ ] def evalDiv : NormNumExt where eval {u α} e := do
436
+ @[norm_num _ / _] def evalDiv : NormNumExt where eval {u α} e := do
437
437
let .app (.app f (a : Q($α))) (b : Q($α)) ← whnfR e | failure
438
438
let dα ← inferDivisionRing α
439
439
haveI' : $e =Q $a / $b := ⟨⟩
@@ -509,7 +509,7 @@ theorem isNat_natSub : {a b : ℕ} → {a' b' c : ℕ} →
509
509
510
510
/-- The `norm_num` extension which identifies expressions of the form `Nat.sub a b`,
511
511
such that `norm_num` successfully recognises both `a` and `b`. -/
512
- @[norm_num (_ : ℕ) - _, Sub.sub (_ : ℕ) _, Nat.sub _ _ ] def evalNatSub :
512
+ @[norm_num (_ : ℕ) - _] def evalNatSub :
513
513
NormNumExt where eval {u α} e := do
514
514
let .app (.app f (a : Q(ℕ))) (b : Q(ℕ)) ← whnfR e | failure
515
515
-- We assert that the default instance for `HSub` is `Nat.sub` when the first parameter is `ℕ`.
@@ -528,7 +528,7 @@ theorem isNat_natMod : {a b : ℕ} → {a' b' c : ℕ} →
528
528
529
529
/-- The `norm_num` extension which identifies expressions of the form `Nat.mod a b`,
530
530
such that `norm_num` successfully recognises both `a` and `b`. -/
531
- @[norm_num (_ : ℕ) % _, Mod.mod (_ : ℕ) _, Nat.mod _ _ ] def evalNatMod :
531
+ @[norm_num (_ : ℕ) % _] def evalNatMod :
532
532
NormNumExt where eval {u α} e := do
533
533
let .app (.app f (a : Q(ℕ))) (b : Q(ℕ)) ← whnfR e | failure
534
534
haveI' : u =QL 0 := ⟨⟩; haveI' : $α =Q ℕ := ⟨⟩
@@ -547,7 +547,7 @@ theorem isNat_natDiv : {a b : ℕ} → {a' b' c : ℕ} →
547
547
548
548
/-- The `norm_num` extension which identifies expressions of the form `Nat.div a b`,
549
549
such that `norm_num` successfully recognises both `a` and `b`. -/
550
- @[norm_num (_ : ℕ) / _, Div.div (_ : ℕ) _, Nat.div _ _ ]
550
+ @[norm_num (_ : ℕ) / _]
551
551
def evalNatDiv : NormNumExt where eval {u α} e := do
552
552
let .app (.app f (a : Q(ℕ))) (b : Q(ℕ)) ← whnfR e | failure
553
553
haveI' : u =QL 0 := ⟨⟩; haveI' : $α =Q ℕ := ⟨⟩
0 commit comments