Skip to content

Commit 44345d8

Browse files
committed
Move the library note to a new file.
Still importing `library_note` in `Tactic.Basic`; we can decide to shake this later but for now I think it's useful to make the command available throughout Mathlib.
1 parent 1e1c930 commit 44345d8

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

Mathlib/Tactic/Basic.lean

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,3 @@ def withResetServerInfo {α : Type} (t : TacticM α) :
158158
return { result?, msgs, trees }
159159

160160
end Mathlib.Tactic
161-
162-
library_note «partially-applied ext lemmas»
163-
/--
164-
When possible, `ext` lemmas are stated without a full set of arguments. As an example, for bundled
165-
homs `f`, `g`, and `of`, `f.comp of = g.comp of → f = g` is a better `ext` lemma than
166-
`(∀ x, f (of x) = g (of x)) → f = g`, as the former allows a second type-specific extensionality
167-
lemmas to be applied to `f.comp of = g.comp of`.
168-
If the domain of `of` is `ℕ` or `ℤ` and `of` is a `RingHom`, such a lemma could then make the goal
169-
`f (of 1) = g (of 1)`.
170-
171-
For bundled morphisms, there is a `ext` lemma that always applies of the form
172-
`(∀ x, ⇑f x = ⇑g x) → f = g`. When adding type-specific `ext` lemmas like the one above, we want
173-
these to be tried first. This happens automatically since the type-specific lemmas are inevitably
174-
defined later.
175-
-/

Mathlib/Tactic/Ext.lean

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/-
2+
Copyright (c) 2020 Eric Wieser. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Eric Wieser
5+
-/
6+
module
7+
8+
public import Mathlib.Tactic.Basic
9+
10+
/-!
11+
# Documentation for `ext` tactic
12+
13+
This file contains a library note on the use of the `ext` tactic and `@[ext]` attribute.
14+
-/
15+
16+
public section
17+
18+
library_note «partially-applied ext lemmas»
19+
/--
20+
When possible, `ext` lemmas are stated without a full set of arguments. As an example, for bundled
21+
homs `f`, `g`, and `of`, `f.comp of = g.comp of → f = g` is a better `ext` lemma than
22+
`(∀ x, f (of x) = g (of x)) → f = g`, as the former allows a second type-specific extensionality
23+
lemmas to be applied to `f.comp of = g.comp of`.
24+
If the domain of `of` is `ℕ` or `ℤ` and `of` is a `RingHom`, such a lemma could then make the goal
25+
`f (of 1) = g (of 1)`.
26+
27+
For bundled morphisms, there is a `ext` lemma that always applies of the form
28+
`(∀ x, ⇑f x = ⇑g x) → f = g`. When adding type-specific `ext` lemmas like the one above, we want
29+
these to be tried first. This happens automatically since the type-specific lemmas are inevitably
30+
defined later.
31+
-/

0 commit comments

Comments
 (0)