Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: separate NeZero dependency from Nat/Cast/Defs (#6955)
I'm trying to remove any extraneous material from the core definitions in the algebraic hierarchy that are used in tactics. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
- Loading branch information
1 parent
6aa77b1
commit 9a51c25
Showing
6 changed files
with
30 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/- | ||
Copyright (c) 2014 Mario Carneiro. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Mario Carneiro, Gabriel Ebner | ||
-/ | ||
import Mathlib.Data.Nat.Cast.Defs | ||
import Mathlib.Algebra.NeZero | ||
|
||
/-! | ||
# Lemmas about nonzero elements of an `AddMonoidWithOne` | ||
-/ | ||
|
||
namespace NeZero | ||
|
||
lemma natCast_ne (n : ℕ) (R) [AddMonoidWithOne R] [h : NeZero (n : R)] : | ||
(n : R) ≠ 0 := h.out | ||
#align ne_zero.nat_cast_ne NeZero.natCast_ne | ||
|
||
lemma of_neZero_natCast (R) [AddMonoidWithOne R] {n : ℕ} [h : NeZero (n : R)] : NeZero n := | ||
⟨by rintro rfl; exact h.out Nat.cast_zero⟩ | ||
#align ne_zero.of_ne_zero_coe NeZero.of_neZero_natCast | ||
|
||
lemma pos_of_neZero_natCast (R) [AddMonoidWithOne R] {n : ℕ} [NeZero (n : R)] : 0 < n := | ||
Nat.pos_of_ne_zero (of_neZero_natCast R).out | ||
#align ne_zero.pos_of_ne_zero_coe NeZero.pos_of_neZero_natCast | ||
|
||
end NeZero |