data.mv_polynomial.pderivMathlib.Data.MvPolynomial.PDeriv

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
 -/
-import Data.MvPolynomial.Degrees
-import Data.MvPolynomial.Derivation
+import Algebra.MvPolynomial.Degrees
+import Algebra.MvPolynomial.Derivation
 
 #align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"5c1efce12ba86d4901463f61019832f6a4b1a0d0"
 
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
 -/
-import Data.MvPolynomial.Variables
+import Data.MvPolynomial.Degrees
 import Data.MvPolynomial.Derivation
 
 #align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"5c1efce12ba86d4901463f61019832f6a4b1a0d0"
Diff
@@ -83,7 +83,7 @@ theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - singl
     (monomial _).map_smul]
   refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
   · simp [Pi.single_eq_of_ne hne]
-  · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
+  · rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
   · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 -/
Diff
@@ -77,7 +77,14 @@ theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.sin
 #print MvPolynomial.pderiv_monomial /-
 @[simp]
 theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) :=
-  by classical
+  by
+  classical
+  simp only [pderiv_def, mk_derivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc, ←
+    (monomial _).map_smul]
+  refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
+  · simp [Pi.single_eq_of_ne hne]
+  · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
+  · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 -/
 
@@ -103,13 +110,14 @@ theorem pderiv_X [DecidableEq σ] (i j : σ) :
 
 #print MvPolynomial.pderiv_X_self /-
 @[simp]
-theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical
+theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
 #align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
 -/
 
 #print MvPolynomial.pderiv_X_of_ne /-
 @[simp]
-theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by classical
+theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by
+  classical simp [h]
 #align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
 -/
 
Diff
@@ -77,14 +77,7 @@ theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.sin
 #print MvPolynomial.pderiv_monomial /-
 @[simp]
 theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) :=
-  by
-  classical
-  simp only [pderiv_def, mk_derivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc, ←
-    (monomial _).map_smul]
-  refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
-  · simp [Pi.single_eq_of_ne hne]
-  · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
-  · simp
+  by classical
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 -/
 
@@ -110,14 +103,13 @@ theorem pderiv_X [DecidableEq σ] (i j : σ) :
 
 #print MvPolynomial.pderiv_X_self /-
 @[simp]
-theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
+theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical
 #align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
 -/
 
 #print MvPolynomial.pderiv_X_of_ne /-
 @[simp]
-theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by
-  classical simp [h]
+theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by classical
 #align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
 -/
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
 -/
-import Mathbin.Data.MvPolynomial.Variables
-import Mathbin.Data.MvPolynomial.Derivation
+import Data.MvPolynomial.Variables
+import Data.MvPolynomial.Derivation
 
 #align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"5c1efce12ba86d4901463f61019832f6a4b1a0d0"
 
Diff
@@ -144,7 +144,7 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
 #print MvPolynomial.pderiv_C_mul /-
 @[simp]
 theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
-  (derivation_c_mul _ _ _).trans C_mul'.symm
+  (derivation_c_hMul _ _ _).trans C_mul'.symm
 #align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_C_mul
 -/
 
Diff
@@ -144,7 +144,7 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
 #print MvPolynomial.pderiv_C_mul /-
 @[simp]
 theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
-  (derivation_C_mul _ _ _).trans C_mul'.symm
+  (derivation_c_mul _ _ _).trans C_mul'.symm
 #align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_C_mul
 -/
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
-
-! This file was ported from Lean 3 source module data.mv_polynomial.pderiv
-! leanprover-community/mathlib commit 5c1efce12ba86d4901463f61019832f6a4b1a0d0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.MvPolynomial.Variables
 import Mathbin.Data.MvPolynomial.Derivation
 
+#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"5c1efce12ba86d4901463f61019832f6a4b1a0d0"
+
 /-!
 # Partial derivatives of polynomials
 
Diff
@@ -77,6 +77,7 @@ theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.sin
 #align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
 -/
 
+#print MvPolynomial.pderiv_monomial /-
 @[simp]
 theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) :=
   by
@@ -88,48 +89,67 @@ theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - singl
   · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
   · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
+-/
 
+#print MvPolynomial.pderiv_C /-
 theorem pderiv_C {i : σ} : pderiv i (C a) = 0 :=
   derivation_C _ _
 #align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
+-/
 
+#print MvPolynomial.pderiv_one /-
 theorem pderiv_one {i : σ} : pderiv i (1 : MvPolynomial σ R) = 0 :=
   pderiv_C
 #align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
+-/
 
+#print MvPolynomial.pderiv_X /-
 @[simp]
 theorem pderiv_X [DecidableEq σ] (i j : σ) :
     pderiv i (X j : MvPolynomial σ R) = @Pi.single _ _ _ _ i 1 j := by
   rw [pderiv_def, mk_derivation_X]
 #align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
+-/
 
+#print MvPolynomial.pderiv_X_self /-
 @[simp]
 theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
 #align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
+-/
 
+#print MvPolynomial.pderiv_X_of_ne /-
 @[simp]
 theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by
   classical simp [h]
 #align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
+-/
 
+#print MvPolynomial.pderiv_eq_zero_of_not_mem_vars /-
 theorem pderiv_eq_zero_of_not_mem_vars {i : σ} {f : MvPolynomial σ R} (h : i ∉ f.vars) :
     pderiv i f = 0 :=
   derivation_eq_zero_of_forall_mem_vars fun j hj => pderiv_X_of_ne <| ne_of_mem_of_not_mem hj h
 #align mv_polynomial.pderiv_eq_zero_of_not_mem_vars MvPolynomial.pderiv_eq_zero_of_not_mem_vars
+-/
 
+#print MvPolynomial.pderiv_monomial_single /-
 theorem pderiv_monomial_single {i : σ} {n : ℕ} :
     pderiv i (monomial (single i n) a) = monomial (single i (n - 1)) (a * n) := by simp
 #align mv_polynomial.pderiv_monomial_single MvPolynomial.pderiv_monomial_single
+-/
 
+#print MvPolynomial.pderiv_mul /-
 theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
     pderiv i (f * g) = pderiv i f * g + f * pderiv i g := by
   simp only [(pderiv i).leibniz f g, smul_eq_mul, mul_comm, add_comm]
 #align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
+-/
 
+#print MvPolynomial.pderiv_C_mul /-
 @[simp]
 theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
   (derivation_C_mul _ _ _).trans C_mul'.symm
 #align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_C_mul
+-/
 
 end Pderiv
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
 
 ! This file was ported from Lean 3 source module data.mv_polynomial.pderiv
-! leanprover-community/mathlib commit 2f5b500a507264de86d666a5f87ddb976e2d8de4
+! leanprover-community/mathlib commit 5c1efce12ba86d4901463f61019832f6a4b1a0d0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Data.MvPolynomial.Derivation
 /-!
 # Partial derivatives of polynomials
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the notion of the formal *partial derivative* of a polynomial,
 the derivative with respect to a single variable.
 This derivative is not connected to the notion of derivative from analysis.
@@ -60,54 +63,58 @@ section Pderiv
 
 variable {R} [CommSemiring R]
 
+#print MvPolynomial.pderiv /-
 /-- `pderiv i p` is the partial derivative of `p` with respect to `i` -/
 def pderiv (i : σ) : Derivation R (MvPolynomial σ R) (MvPolynomial σ R) :=
   letI := Classical.decEq σ
   mk_derivation R <| Pi.single i 1
 #align mv_polynomial.pderiv MvPolynomial.pderiv
+-/
 
+#print MvPolynomial.pderiv_def /-
 theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.single i 1) := by
   convert rfl
 #align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
+-/
 
 @[simp]
 theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) :=
   by
   classical
-    simp only [pderiv_def, mk_derivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc,
-      ← (monomial _).map_smul]
-    refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
-    · simp [Pi.single_eq_of_ne hne]
-    · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
-    · simp
+  simp only [pderiv_def, mk_derivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc, ←
+    (monomial _).map_smul]
+  refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
+  · simp [Pi.single_eq_of_ne hne]
+  · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
+  · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 
-theorem pderiv_c {i : σ} : pderiv i (C a) = 0 :=
-  derivation_c _ _
-#align mv_polynomial.pderiv_C MvPolynomial.pderiv_c
+theorem pderiv_C {i : σ} : pderiv i (C a) = 0 :=
+  derivation_C _ _
+#align mv_polynomial.pderiv_C MvPolynomial.pderiv_C
 
 theorem pderiv_one {i : σ} : pderiv i (1 : MvPolynomial σ R) = 0 :=
-  pderiv_c
+  pderiv_C
 #align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
 
 @[simp]
-theorem pderiv_x [DecidableEq σ] (i j : σ) :
+theorem pderiv_X [DecidableEq σ] (i j : σ) :
     pderiv i (X j : MvPolynomial σ R) = @Pi.single _ _ _ _ i 1 j := by
   rw [pderiv_def, mk_derivation_X]
-#align mv_polynomial.pderiv_X MvPolynomial.pderiv_x
+#align mv_polynomial.pderiv_X MvPolynomial.pderiv_X
 
 @[simp]
-theorem pderiv_x_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
-#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_x_self
+theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
+#align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_X_self
 
 @[simp]
-theorem pderiv_x_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by
+theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by
   classical simp [h]
-#align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_x_of_ne
+#align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_X_of_ne
 
 theorem pderiv_eq_zero_of_not_mem_vars {i : σ} {f : MvPolynomial σ R} (h : i ∉ f.vars) :
     pderiv i f = 0 :=
-  derivation_eq_zero_of_forall_mem_vars fun j hj => pderiv_x_of_ne <| ne_of_mem_of_not_mem hj h
+  derivation_eq_zero_of_forall_mem_vars fun j hj => pderiv_X_of_ne <| ne_of_mem_of_not_mem hj h
 #align mv_polynomial.pderiv_eq_zero_of_not_mem_vars MvPolynomial.pderiv_eq_zero_of_not_mem_vars
 
 theorem pderiv_monomial_single {i : σ} {n : ℕ} :
@@ -120,9 +127,9 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
 #align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
 
 @[simp]
-theorem pderiv_c_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
-  (derivation_c_mul _ _ _).trans C_mul'.symm
-#align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_c_mul
+theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
+  (derivation_C_mul _ _ _).trans C_mul'.symm
+#align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_C_mul
 
 end Pderiv
 
Diff
@@ -78,7 +78,7 @@ theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - singl
       ← (monomial _).map_smul]
     refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
     · simp [Pi.single_eq_of_ne hne]
-    · rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
+    · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
     · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 
Diff
@@ -52,7 +52,7 @@ namespace MvPolynomial
 
 open Set Function Finsupp AddMonoidAlgebra
 
-open BigOperators
+open scoped BigOperators
 
 variable {R : Type u} {σ : Type v} {a a' a₁ a₂ : R} {s : σ →₀ ℕ}
 
Diff
@@ -78,8 +78,7 @@ theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - singl
       ← (monomial _).map_smul]
     refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
     · simp [Pi.single_eq_of_ne hne]
-    · rw [Finsupp.not_mem_support_iff] at hi
-      simp [hi]
+    · rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
     · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
 
 ! This file was ported from Lean 3 source module data.mv_polynomial.pderiv
-! leanprover-community/mathlib commit 67dcdef25397eedde255db0876b9c55eab2a62a2
+! leanprover-community/mathlib commit 2f5b500a507264de86d666a5f87ddb976e2d8de4
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -52,7 +52,7 @@ namespace MvPolynomial
 
 open Set Function Finsupp AddMonoidAlgebra
 
-open Classical BigOperators
+open BigOperators
 
 variable {R : Type u} {σ : Type v} {a a' a₁ a₂ : R} {s : σ →₀ ℕ}
 
@@ -62,19 +62,25 @@ variable {R} [CommSemiring R]
 
 /-- `pderiv i p` is the partial derivative of `p` with respect to `i` -/
 def pderiv (i : σ) : Derivation R (MvPolynomial σ R) (MvPolynomial σ R) :=
-  mkDerivation R <| Pi.single i 1
+  letI := Classical.decEq σ
+  mk_derivation R <| Pi.single i 1
 #align mv_polynomial.pderiv MvPolynomial.pderiv
 
+theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.single i 1) := by
+  convert rfl
+#align mv_polynomial.pderiv_def MvPolynomial.pderiv_def
+
 @[simp]
 theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) :=
   by
-  simp only [pderiv, mk_derivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc, ←
-    (monomial _).map_smul]
-  refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
-  · simp [Pi.single_eq_of_ne hne]
-  · rw [Finsupp.not_mem_support_iff] at hi
-    simp [hi]
-  · simp
+  classical
+    simp only [pderiv_def, mk_derivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc,
+      ← (monomial _).map_smul]
+    refine' (Finset.sum_eq_single i (fun j hj hne => _) fun hi => _).trans _
+    · simp [Pi.single_eq_of_ne hne]
+    · rw [Finsupp.not_mem_support_iff] at hi
+      simp [hi]
+    · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 
 theorem pderiv_c {i : σ} : pderiv i (C a) = 0 :=
@@ -86,17 +92,18 @@ theorem pderiv_one {i : σ} : pderiv i (1 : MvPolynomial σ R) = 0 :=
 #align mv_polynomial.pderiv_one MvPolynomial.pderiv_one
 
 @[simp]
-theorem pderiv_x [d : DecidableEq σ] (i j : σ) :
-    pderiv i (X j : MvPolynomial σ R) = @Pi.single σ _ d _ i 1 j :=
-  (mkDerivation_x _ _ _).trans (by congr )
+theorem pderiv_x [DecidableEq σ] (i j : σ) :
+    pderiv i (X j : MvPolynomial σ R) = @Pi.single _ _ _ _ i 1 j := by
+  rw [pderiv_def, mk_derivation_X]
 #align mv_polynomial.pderiv_X MvPolynomial.pderiv_x
 
 @[simp]
-theorem pderiv_x_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by simp
+theorem pderiv_x_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by classical simp
 #align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_x_self
 
 @[simp]
-theorem pderiv_x_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by simp [h]
+theorem pderiv_x_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by
+  classical simp [h]
 #align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_x_of_ne
 
 theorem pderiv_eq_zero_of_not_mem_vars {i : σ} {f : MvPolynomial σ R} (h : i ∉ f.vars) :
Diff
@@ -77,7 +77,7 @@ theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - singl
   · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 
-theorem pderiv_c {i : σ} : pderiv i (c a) = 0 :=
+theorem pderiv_c {i : σ} : pderiv i (C a) = 0 :=
   derivation_c _ _
 #align mv_polynomial.pderiv_C MvPolynomial.pderiv_c
 
@@ -87,16 +87,16 @@ theorem pderiv_one {i : σ} : pderiv i (1 : MvPolynomial σ R) = 0 :=
 
 @[simp]
 theorem pderiv_x [d : DecidableEq σ] (i j : σ) :
-    pderiv i (x j : MvPolynomial σ R) = @Pi.single σ _ d _ i 1 j :=
+    pderiv i (X j : MvPolynomial σ R) = @Pi.single σ _ d _ i 1 j :=
   (mkDerivation_x _ _ _).trans (by congr )
 #align mv_polynomial.pderiv_X MvPolynomial.pderiv_x
 
 @[simp]
-theorem pderiv_x_self (i : σ) : pderiv i (x i : MvPolynomial σ R) = 1 := by simp
+theorem pderiv_x_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1 := by simp
 #align mv_polynomial.pderiv_X_self MvPolynomial.pderiv_x_self
 
 @[simp]
-theorem pderiv_x_of_ne {i j : σ} (h : j ≠ i) : pderiv i (x j : MvPolynomial σ R) = 0 := by simp [h]
+theorem pderiv_x_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0 := by simp [h]
 #align mv_polynomial.pderiv_X_of_ne MvPolynomial.pderiv_x_of_ne
 
 theorem pderiv_eq_zero_of_not_mem_vars {i : σ} {f : MvPolynomial σ R} (h : i ∉ f.vars) :
@@ -114,8 +114,8 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
 #align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
 
 @[simp]
-theorem pderiv_c_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (c a * f) = c a * pderiv i f :=
-  (derivation_c_mul _ _ _).trans c_mul'.symm
+theorem pderiv_c_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
+  (derivation_c_mul _ _ _).trans C_mul'.symm
 #align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_c_mul
 
 end Pderiv

Changes in mathlib4

mathlib3
mathlib4
move(Polynomial): Move out of Data (#11751)

Polynomial and MvPolynomial are algebraic objects, hence should be under Algebra (or at least not under Data)

Diff
@@ -3,8 +3,8 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
 -/
-import Mathlib.Data.MvPolynomial.Variables
-import Mathlib.Data.MvPolynomial.Derivation
+import Mathlib.Algebra.MvPolynomial.Derivation
+import Mathlib.Algebra.MvPolynomial.Variables
 
 #align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
 
feat(AlgebraicGeometry/EllipticCurve/Jacobian): implement equations and nonsingularity for Jacobian coordinates (#9432)

Define a Jacobian point representative over a ring R as the type Fin 3 -> R, and its equivalence class PointClass as a quotient by the usual weighted scaling relation. Define the analogous equation and nonsingular predicates on Fin 3 -> F over a field F, and lift nonsingular to PointClass. This also has minimal API (e.g. it's missing many of the equation lemmas) as most computations should ideally be done using the affine API.

This is the first in a series of four PRs leading to #9405 and is analogous to #9416

Diff
@@ -119,6 +119,10 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
   simp only [(pderiv i).leibniz f g, smul_eq_mul, mul_comm, add_comm]
 #align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
 
+theorem pderiv_pow {i : σ} {f : MvPolynomial σ R} {n : ℕ} :
+    pderiv i (f ^ n) = n * f ^ (n - 1) * pderiv i f := by
+  rw [(pderiv i).leibniz_pow f n, nsmul_eq_mul, smul_eq_mul, mul_assoc]
+
 -- @[simp] -- Porting note (#10618): simp can prove this
 theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f := by
   rw [C_mul', Derivation.map_smul, C_mul']
chore: classify simp can do this porting notes (#10619)

Classify by adding issue number (#10618) to porting notes claiming anything semantically equivalent to simp can prove this or simp can simplify this.

Diff
@@ -119,7 +119,7 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
   simp only [(pderiv i).leibniz f g, smul_eq_mul, mul_comm, add_comm]
 #align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
 
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
 theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f := by
   rw [C_mul', Derivation.map_smul, C_mul']
 set_option linter.uppercaseLean3 false in
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -25,9 +25,9 @@ It is based purely on the polynomial exponents and coefficients.
 
 As in other polynomial files, we typically use the notation:
 
-+ `σ : Type _` (indexing the variables)
++ `σ : Type*` (indexing the variables)
 
-+ `R : Type _` `[CommRing R]` (the coefficients)
++ `R : Type*` `[CommRing R]` (the coefficients)
 
 + `s : σ →₀ ℕ`, a function from `σ` to `ℕ` which is zero away from a finite set.
 This will give rise to a monomial in `MvPolynomial σ R` which mathematicians might call `X^s`
feat: derivations of (univariate) polynomials (#6023)

An R-derivation from R[X] is determined by its value on X. Joint work with Richard Hill, who needs this stuff for his work on power series. We followed MvPolynomial.Derivation .

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Oliver Nash <github@olivernash.org>

Diff
@@ -120,8 +120,8 @@ theorem pderiv_mul {i : σ} {f g : MvPolynomial σ R} :
 #align mv_polynomial.pderiv_mul MvPolynomial.pderiv_mul
 
 -- @[simp] -- Porting note: simp can prove this
-theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f :=
-  (derivation_C_mul _ _ _).trans C_mul'.symm
+theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f := by
+  rw [C_mul', Derivation.map_smul, C_mul']
 set_option linter.uppercaseLean3 false in
 #align mv_polynomial.pderiv_C_mul MvPolynomial.pderiv_C_mul
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Shing Tak Lam, Yury Kudryashov
-
-! This file was ported from Lean 3 source module data.mv_polynomial.pderiv
-! leanprover-community/mathlib commit 2f5b500a507264de86d666a5f87ddb976e2d8de4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.MvPolynomial.Variables
 import Mathlib.Data.MvPolynomial.Derivation
 
+#align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
+
 /-!
 # Partial derivatives of polynomials
 
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -78,7 +78,7 @@ theorem pderiv_monomial {i : σ} :
       ← (monomial _).map_smul]
     refine' (Finset.sum_eq_single i (fun j _ hne => _) fun hi => _).trans _
     · simp [Pi.single_eq_of_ne hne]
-    · rw [Finsupp.not_mem_support_iff] at hi ; simp [hi]
+    · rw [Finsupp.not_mem_support_iff] at hi; simp [hi]
     · simp
 #align mv_polynomial.pderiv_monomial MvPolynomial.pderiv_monomial
 
feat: port Data.MvPolynomial.PDeriv (#4612)

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 8 + 469

470 files ported (98.3%)
193932 lines ported (98.4%)
Show graph

The unported dependencies are