File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
src/Lean/Meta/Tactic/Grind/Arith/Linear Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ def getStructId? (type : Expr) : GoalM (Option Nat) := do
171171 return id?
172172where
173173 go? : GoalM (Option Nat) := do
174- let u ← getDecLevel type
174+ let some u ← getDecLevel? type | return none
175175 let ringId? ← CommRing.getCommRingId? type
176176 let leInst? ← getInst? ``LE u type
177177 let ltInst? ← getInst? ``LT u type
Original file line number Diff line number Diff line change 1+ variable {α : Sort u} {β : α → Sort v} {α' : Sort w} [DecidableEq α]
2+ {f : (a : α) → β a} {a : α} {b : β a}
3+
4+ /-- Replacing the value of a function at a given point by a given value. -/
5+ def Function.update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
6+ if h : a = a' then Eq.ndrec v h.symm else f a
7+
8+ @[simp]
9+ theorem Function.update_self (a : α) (v : β a) (f : ∀ a, β a) : update f a v a = v :=
10+ dif_pos rfl
11+
12+ @[simp]
13+ theorem Function.update_of_ne {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) : update f a' v a = f a :=
14+ dif_neg h
15+
16+ theorem domDomRestrict_aux {ι : Sort u_1} [DecidableEq ι] (P : ι → Prop ) [DecidablePred P] {M₁ : ι → Type u_2}
17+ [DecidableEq {a // P a}]
18+ (x : (i : {a // P a}) → M₁ i) (z : (i : {a // ¬ P a}) → M₁ i) (i : {a : ι // P a})
19+ (c : M₁ i) : (fun j ↦ if h : P j then Function.update x i c ⟨j, h⟩ else z ⟨j, h⟩) =
20+ Function.update (fun j => if h : P j then x ⟨j, h⟩ else z ⟨j, h⟩) i c := by
21+ ext j
22+ by_cases h : j = i <;> grind only [Function.update_self, Function.update_of_ne]
You can’t perform that action at this time.
0 commit comments