NNG progress
parent
f8ae5795cb
commit
b1a53aba05
@ -1,5 +1,18 @@
|
|||||||
import GameServer.Commands
|
import GameServer.Commands
|
||||||
import NNG.Doc.Tactics
|
|
||||||
import NNG.Doc.Lemmas
|
import NNG.MyNat.Definition
|
||||||
|
|
||||||
import NNG.Doc.Definitions
|
import NNG.Doc.Definitions
|
||||||
import NNG.Modifications.Tactics
|
import NNG.Doc.Lemmas
|
||||||
|
import NNG.Doc.Tactics
|
||||||
|
|
||||||
|
import NNG.Tactic.Induction
|
||||||
|
import NNG.Tactic.Rfl
|
||||||
|
import NNG.Tactic.Rw
|
||||||
|
import Std.Tactic.RCases
|
||||||
|
import Mathlib.Tactic.Have
|
||||||
|
import Mathlib.Tactic.LeftRight
|
||||||
|
|
||||||
|
-- TODO: Why does this not work here??
|
||||||
|
-- We do not want `simp` to be able to do anything unless we unlock it manually.
|
||||||
|
attribute [-simp] MyNat.succ.injEq
|
||||||
@ -1 +0,0 @@
|
|||||||
theorem not_iff_imp_false (P : Prop) : ¬ P ↔ P → false := by simp only
|
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
import Mathlib.Lean.Expr.Basic
|
||||||
|
import Lean.Elab.Tactic.Basic
|
||||||
|
|
||||||
|
/-!
|
||||||
|
# Modified `rw`
|
||||||
|
|
||||||
|
Modify `rw` to work like `rewrite`.
|
||||||
|
|
||||||
|
This is mainly a copy of the implementation of `rewrite` in Lean core.
|
||||||
|
-/
|
||||||
|
|
||||||
|
namespace MyNat
|
||||||
|
|
||||||
|
open Lean.Meta Lean.Elab.Tactic Lean.Parser.Tactic
|
||||||
|
|
||||||
|
/--
|
||||||
|
Modified `rw` tactic. For this game, `rw` works exactly like `rewrite`.
|
||||||
|
-/
|
||||||
|
syntax (name := rewriteSeq) "rw" (config)? rwRuleSeq (location)? : tactic
|
||||||
|
|
||||||
|
@[tactic MyNat.rewriteSeq] def evalRewriteSeq : Tactic := fun stx => do
|
||||||
|
let cfg ← elabRewriteConfig stx[1]
|
||||||
|
let loc := expandOptLocation stx[3]
|
||||||
|
withRWRulesSeq stx[0] stx[2] fun symm term => do
|
||||||
|
withLocation loc
|
||||||
|
(rewriteLocalDecl term symm · cfg)
|
||||||
|
(rewriteTarget term symm cfg)
|
||||||
|
(throwTacticEx `rewrite · "did not find instance of the pattern in the current goal")
|
||||||
Loading…
Reference in New Issue