-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tactic/ComputeDegree): add helper lemmas for
compute_degree_le
(…
…#5978) This PR is a prequel to #5882: it simply adds the helper lemmas about polynomials that the tactic uses. [Zulip discussion ](https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.235882.20.60compute_degree_le.60) Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
- Loading branch information
1 parent
784034b
commit b48d2bd
Showing
4 changed files
with
90 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/- | ||
Copyright (c) 2023 Damiano Testa. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Damiano Testa | ||
-/ | ||
|
||
import Mathlib.Data.Polynomial.Degree.Definitions | ||
|
||
/-! | ||
### Simple lemmas about `natDegree` | ||
The lemmas in this section all have the form `natDegree <some form of cast> ≤ 0`. | ||
Their proofs are weakenings of the stronger lemmas `natDegree <same> = 0`. | ||
These are the lemmas called by `compute_degree_le` on (almost) all the leaves of its recursion. | ||
-/ | ||
|
||
open Polynomial | ||
|
||
namespace Mathlib.Tactic.ComputeDegree | ||
|
||
section leaf_lemmas | ||
|
||
variable {R : Type _} | ||
|
||
section semiring | ||
variable [Semiring R] | ||
|
||
theorem natDegree_C_le (a : R) : natDegree (C a) ≤ 0 := (natDegree_C a).le | ||
theorem natDegree_nat_cast_le (n : ℕ) : natDegree (n : R[X]) ≤ 0 := (natDegree_nat_cast _).le | ||
theorem natDegree_zero_le : natDegree (0 : R[X]) ≤ 0 := natDegree_zero.le | ||
theorem natDegree_one_le : natDegree (1 : R[X]) ≤ 0 := natDegree_one.le | ||
|
||
end semiring | ||
|
||
variable [Ring R] in | ||
theorem natDegree_int_cast_le (n : ℤ) : natDegree (n : R[X]) ≤ 0 := (natDegree_int_cast _).le | ||
|
||
end leaf_lemmas | ||
|
||
end Mathlib.Tactic.ComputeDegree |