Skip to content

Commit 71e1058

Browse files
merge lean-pr-testing-11587
2 parents f307418 + 1a6e7c7 commit 71e1058

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

Mathlib/Data/Fin/VecNotation.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ open Lean Qq
145145
146146
`let ⟨xs, tailn, tail⟩ ← matchVecConsPrefix n e` decomposes `e : Fin n → _` in the form
147147
`vecCons x₀ <| ... <| vecCons xₙ <| tail` where `tail : Fin tailn → _`. -/
148-
meta def matchVecConsPrefix (n : Q(Nat)) (e : Expr) : MetaM <| List Expr × Q(Nat) × Expr := do
148+
meta partial def matchVecConsPrefix (n : Q(Nat)) (e : Expr) :
149+
MetaM <| List Expr × Q(Nat) × Expr := do
149150
match_expr ← Meta.whnfR e with
150151
| Matrix.vecCons _ n x xs => do
151152
let (elems, n', tail) ← matchVecConsPrefix n xs

Mathlib/FieldTheory/IntermediateField/Adjoin/Defs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ scoped macro:max K:term "⟮" xs:term,* "⟯" : term => do ``(adjoin $K $(← mk
521521

522522
open Lean PrettyPrinter.Delaborator SubExpr in
523523
@[app_delab IntermediateField.adjoin]
524-
meta def delabAdjoinNotation : Delab := whenPPOption getPPNotation do
524+
meta partial def delabAdjoinNotation : Delab := whenPPOption getPPNotation do
525525
let e ← getExpr
526526
guard <| e.isAppOfArity ``adjoin 6
527527
let F ← withNaryArg 0 delab

Mathlib/Tactic/Linarith/Frontend.lean

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,18 @@ elab_rules : tactic
515515
let cfg := (← elabLinarithConfig cfg).updateReducibility bang.isSome
516516
commitIfNoEx do liftMetaFinishingTactic <| Linarith.linarith o.isSome args.toList cfg
517517

518+
private meta partial def minimize (cfg : Linarith.LinarithConfig) (st : Tactic.SavedState)
519+
(g : MVarId) (hs : List Expr) (i : Nat) : TacticM (List Expr) := do
520+
if _h : i < hs.length then
521+
let rest := hs.eraseIdx i
522+
st.restore
523+
try
524+
let _ ← Linarith.linarith true rest cfg g
525+
minimize cfg st g rest i
526+
catch _ => minimize cfg st g hs (i+1)
527+
else
528+
return hs
529+
518530
elab_rules : tactic
519531
| `(tactic| linarith?%$tk $[!%$bang]? $cfg:optConfig $[only%$o]? $[[$args,*]]?) =>
520532
withMainContext do
@@ -530,17 +542,7 @@ elab_rules : tactic
530542
throwError "linarith? currently only supports named hypothesis, not terms"
531543
let used ←
532544
if cfg.minimize then
533-
let rec minimize (hs : List Expr) (i : Nat) : TacticM (List Expr) := do
534-
if _h : i < hs.length then
535-
let rest := hs.eraseIdx i
536-
st.restore
537-
try
538-
let _ ← Linarith.linarith true rest cfg g
539-
minimize rest i
540-
catch _ => minimize hs (i+1)
541-
else
542-
return hs
543-
minimize used₀ 0
545+
minimize cfg st g used₀ 0
544546
else
545547
pure used₀
546548
st.restore

lake-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
"inputRev": "nightly-testing",
5252
"inherited": false,
5353
"configFile": "lakefile.toml"},
54-
{"url": "https://github.com/leanprover-community/quote4",
54+
{"url": "https://github.com/Kha/quote4",
5555
"type": "git",
5656
"subDir": null,
57-
"scope": "leanprover-community",
58-
"rev": "2fa5d6eaad021d45b7262e79cbf6f68a2d65adfd",
57+
"scope": "",
58+
"rev": "7032fae8ca26da4982852b813f2af6c1dcd9d1cc",
5959
"name": "Qq",
6060
"manifestFile": "lake-manifest.json",
6161
"inputRev": "nightly-testing",

lakefile.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ open Lake DSL
77
-/
88

99
require "leanprover-community" / "batteries" @ git "nightly-testing"
10-
require "leanprover-community" / "Qq" @ git "nightly-testing"
10+
require "Qq" from git "https://github.com/Kha/quote4" @ "nightly-testing"
1111
require "leanprover-community" / "aesop" @ git "nightly-testing"
1212
require "leanprover-community" / "proofwidgets" @ git "v0.0.83-pre2" -- ProofWidgets should always be pinned to a specific version
1313
with NameMap.empty.insert `errorOnBuild

0 commit comments

Comments
 (0)