-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
define attribute before tactic, to reduce import size
- Loading branch information
Showing
8 changed files
with
58 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import Mathlib.Tactic.Push.Attr | ||
import Mathlib.Tactic.Push.Basic | ||
import Mathlib.Tactic.Push.Lemmas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/- | ||
Copyright (c) 2025 Jovan Gerbscheid. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jovan Gerbscheid, Patrick Massot, Simon Hudon, Alice Laroche, Frédéric Dupuis, | ||
Jireh Loreaux | ||
-/ | ||
import Mathlib.Init | ||
|
||
/-! | ||
# The `@[push]` attribute for the `push` and `push_neg` tactics | ||
This file defines the `@[push]` attribute, so that it can be used without importing | ||
the tactic itself. | ||
-/ | ||
|
||
namespace Mathlib.Tactic.Push | ||
|
||
open Lean Meta | ||
|
||
/-- The `push` simp attribute. -/ | ||
initialize pushExt : SimpExtension ← mkSimpExt | ||
|
||
/-- | ||
The `push` attribute is used to tag lemmas that "push" a constant into an expression. | ||
For example: | ||
```lean | ||
@[push] theorem not_not (p : Prop) : ¬¬p ↔ p | ||
@[push] theorem not_imp (p q : Prop) : ¬(p → q) ↔ p ∧ ¬q | ||
@[push] theorem not_iff (p q : Prop) : ¬(p ↔ q) ↔ (p ∧ ¬q) ∨ (¬p ∧ q) | ||
``` | ||
-/ | ||
syntax (name := pushAttr) "push" ("← " <|> "<- ")? (ppSpace prio)? : attr | ||
|
||
initialize registerBuiltinAttribute { | ||
name := `pushAttr | ||
descr := "attribute for push" | ||
add := fun decl stx kind => MetaM.run' do | ||
let inv := !stx[1].isNone | ||
let prio ← getAttrParamOptPrio stx[2] | ||
addSimpTheorem pushExt decl (post := false) (inv := inv) kind prio | ||
} | ||
|
||
end Mathlib.Tactic.Push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters