data.mv_polynomial.derivationMathlib.Data.MvPolynomial.Derivation

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Data.MvPolynomial.Supported
+import Algebra.MvPolynomial.Supported
 import RingTheory.Derivation.Basic
 
 #align_import data.mv_polynomial.derivation from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
Diff
@@ -84,7 +84,7 @@ theorem derivation_c_hMul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f :
 theorem derivation_eqOn_supported {D₁ D₂ : Derivation R (MvPolynomial σ R) A} {s : Set σ}
     (h : Set.EqOn (D₁ ∘ X) (D₂ ∘ X) s) {f : MvPolynomial σ R} (hf : f ∈ supported R s) :
     D₁ f = D₂ f :=
-  Derivation.eqOn_adjoin (Set.ball_image_iff.2 h) hf
+  Derivation.eqOn_adjoin (Set.forall_mem_image.2 h) hf
 #align mv_polynomial.derivation_eq_on_supported MvPolynomial.derivation_eqOn_supported
 -/
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathbin.Data.MvPolynomial.Supported
-import Mathbin.RingTheory.Derivation.Basic
+import Data.MvPolynomial.Supported
+import RingTheory.Derivation.Basic
 
 #align_import data.mv_polynomial.derivation from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
 
Diff
@@ -74,9 +74,9 @@ theorem derivation_C (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a)
 -/
 
 @[simp]
-theorem derivation_c_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
+theorem derivation_c_hMul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
     D (C a * f) = a • D f := by rw [C_mul', D.map_smul]
-#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_c_mul
+#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_c_hMul
 
 #print MvPolynomial.derivation_eqOn_supported /-
 /-- If two derivations agree on `X i`, `i ∈ s`, then they agree on all polynomials from
Diff
@@ -73,12 +73,10 @@ theorem derivation_C (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a)
 #align mv_polynomial.derivation_C MvPolynomial.derivation_C
 -/
 
-#print MvPolynomial.derivation_C_mul /-
 @[simp]
-theorem derivation_C_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
+theorem derivation_c_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
     D (C a * f) = a • D f := by rw [C_mul', D.map_smul]
-#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_C_mul
--/
+#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_c_mul
 
 #print MvPolynomial.derivation_eqOn_supported /-
 /-- If two derivations agree on `X i`, `i ∈ s`, then they agree on all polynomials from
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module data.mv_polynomial.derivation
-! leanprover-community/mathlib commit af471b9e3ce868f296626d33189b4ce730fa4c00
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.MvPolynomial.Supported
 import Mathbin.RingTheory.Derivation.Basic
 
+#align_import data.mv_polynomial.derivation from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
+
 /-!
 # Derivations of multivariate polynomials
 
Diff
@@ -49,30 +49,41 @@ def mkDerivationₗ (f : σ → A) : MvPolynomial σ R →ₗ[R] A :=
 
 end
 
+#print MvPolynomial.mkDerivationₗ_monomial /-
 theorem mkDerivationₗ_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
     mkDerivationₗ R f (monomial s r) =
       r • s.Sum fun i k => monomial (s - Finsupp.single i 1) (k : R) • f i :=
   sum_monomial_eq <| LinearMap.map_zero _
 #align mv_polynomial.mk_derivationₗ_monomial MvPolynomial.mkDerivationₗ_monomial
+-/
 
+#print MvPolynomial.mkDerivationₗ_C /-
 theorem mkDerivationₗ_C (f : σ → A) (r : R) : mkDerivationₗ R f (C r) = 0 :=
   (mkDerivationₗ_monomial f _ _).trans (smul_zero _)
 #align mv_polynomial.mk_derivationₗ_C MvPolynomial.mkDerivationₗ_C
+-/
 
+#print MvPolynomial.mkDerivationₗ_X /-
 theorem mkDerivationₗ_X (f : σ → A) (i : σ) : mkDerivationₗ R f (X i) = f i :=
   (mkDerivationₗ_monomial f _ _).trans <| by simp
 #align mv_polynomial.mk_derivationₗ_X MvPolynomial.mkDerivationₗ_X
+-/
 
+#print MvPolynomial.derivation_C /-
 @[simp]
 theorem derivation_C (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a) = 0 :=
   D.map_algebraMap a
 #align mv_polynomial.derivation_C MvPolynomial.derivation_C
+-/
 
+#print MvPolynomial.derivation_C_mul /-
 @[simp]
 theorem derivation_C_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
     D (C a * f) = a • D f := by rw [C_mul', D.map_smul]
 #align mv_polynomial.derivation_C_mul MvPolynomial.derivation_C_mul
+-/
 
+#print MvPolynomial.derivation_eqOn_supported /-
 /-- If two derivations agree on `X i`, `i ∈ s`, then they agree on all polynomials from
 `mv_polynomial.supported R s`. -/
 theorem derivation_eqOn_supported {D₁ D₂ : Derivation R (MvPolynomial σ R) A} {s : Set σ}
@@ -80,25 +91,33 @@ theorem derivation_eqOn_supported {D₁ D₂ : Derivation R (MvPolynomial σ R)
     D₁ f = D₂ f :=
   Derivation.eqOn_adjoin (Set.ball_image_iff.2 h) hf
 #align mv_polynomial.derivation_eq_on_supported MvPolynomial.derivation_eqOn_supported
+-/
 
+#print MvPolynomial.derivation_eq_of_forall_mem_vars /-
 theorem derivation_eq_of_forall_mem_vars {D₁ D₂ : Derivation R (MvPolynomial σ R) A}
     {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D₁ (X i) = D₂ (X i)) : D₁ f = D₂ f :=
   derivation_eqOn_supported h f.mem_supported_vars
 #align mv_polynomial.derivation_eq_of_forall_mem_vars MvPolynomial.derivation_eq_of_forall_mem_vars
+-/
 
+#print MvPolynomial.derivation_eq_zero_of_forall_mem_vars /-
 theorem derivation_eq_zero_of_forall_mem_vars {D : Derivation R (MvPolynomial σ R) A}
     {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D (X i) = 0) : D f = 0 :=
   show D f = (0 : Derivation R (MvPolynomial σ R) A) f from derivation_eq_of_forall_mem_vars h
 #align mv_polynomial.derivation_eq_zero_of_forall_mem_vars MvPolynomial.derivation_eq_zero_of_forall_mem_vars
+-/
 
+#print MvPolynomial.derivation_ext /-
 @[ext]
 theorem derivation_ext {D₁ D₂ : Derivation R (MvPolynomial σ R) A} (h : ∀ i, D₁ (X i) = D₂ (X i)) :
     D₁ = D₂ :=
   Derivation.ext fun f => derivation_eq_of_forall_mem_vars fun i _ => h i
 #align mv_polynomial.derivation_ext MvPolynomial.derivation_ext
+-/
 
 variable [IsScalarTower R (MvPolynomial σ R) A]
 
+#print MvPolynomial.leibniz_iff_X /-
 theorem leibniz_iff_X (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
     (∀ p q, D (p * q) = p • D q + q • D p) ↔
       ∀ s i,
@@ -124,6 +143,7 @@ theorem leibniz_iff_X (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
   case h_X q i hq =>
     simp only [this, ← mul_assoc, hq, mul_smul, smul_add, smul_comm (X i), add_assoc]
 #align mv_polynomial.leibniz_iff_X MvPolynomial.leibniz_iff_X
+-/
 
 variable (R)
 
@@ -148,17 +168,22 @@ def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
 #align mv_polynomial.mk_derivation MvPolynomial.mkDerivation
 -/
 
+#print MvPolynomial.mkDerivation_X /-
 @[simp]
 theorem mkDerivation_X (f : σ → A) (i : σ) : mkDerivation R f (X i) = f i :=
   mkDerivationₗ_X f i
 #align mv_polynomial.mk_derivation_X MvPolynomial.mkDerivation_X
+-/
 
+#print MvPolynomial.mkDerivation_monomial /-
 theorem mkDerivation_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
     mkDerivation R f (monomial s r) =
       r • s.Sum fun i k => monomial (s - Finsupp.single i 1) (k : R) • f i :=
   mkDerivationₗ_monomial f s r
 #align mv_polynomial.mk_derivation_monomial MvPolynomial.mkDerivation_monomial
+-/
 
+#print MvPolynomial.mkDerivationEquiv /-
 /-- `mv_polynomial.mk_derivation` as a linear equivalence. -/
 def mkDerivationEquiv : (σ → A) ≃ₗ[R] Derivation R (MvPolynomial σ R) A :=
   LinearEquiv.symm <|
@@ -169,6 +194,7 @@ def mkDerivationEquiv : (σ → A) ≃ₗ[R] Derivation R (MvPolynomial σ R) A
       left_inv := fun D => derivation_ext <| mkDerivation_X _ _
       right_inv := fun f => funext <| mkDerivation_X _ _ }
 #align mv_polynomial.mk_derivation_equiv MvPolynomial.mkDerivationEquiv
+-/
 
 end MvPolynomial
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module data.mv_polynomial.derivation
-! leanprover-community/mathlib commit b608348ffaeb7f557f2fd46876037abafd326ff3
+! leanprover-community/mathlib commit af471b9e3ce868f296626d33189b4ce730fa4c00
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.RingTheory.Derivation.Basic
 /-!
 # Derivations of multivariate polynomials
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we prove that a derivation of `mv_polynomial σ R` is determined by its values on all
 monomials `mv_polynomial.X i`. We also provide a constructor `mv_polynomial.mk_derivation` that
 builds a derivation from its values on `X i`s and a linear equivalence
@@ -34,6 +37,7 @@ section
 
 variable (R)
 
+#print MvPolynomial.mkDerivationₗ /-
 /-- The derivation on `mv_polynomial σ R` that takes value `f i` on `X i`, as a linear map.
 Use `mv_polynomial.mk_derivation` instead. -/
 def mkDerivationₗ (f : σ → A) : MvPolynomial σ R →ₗ[R] A :=
@@ -41,6 +45,7 @@ def mkDerivationₗ (f : σ → A) : MvPolynomial σ R →ₗ[R] A :=
     (LinearMap.ringLmapEquivSelf R R A).symm <|
       xs.Sum fun i k => monomial (xs - Finsupp.single i 1) (k : R) • f i
 #align mv_polynomial.mk_derivationₗ MvPolynomial.mkDerivationₗ
+-/
 
 end
 
@@ -50,23 +55,23 @@ theorem mkDerivationₗ_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
   sum_monomial_eq <| LinearMap.map_zero _
 #align mv_polynomial.mk_derivationₗ_monomial MvPolynomial.mkDerivationₗ_monomial
 
-theorem mkDerivationₗ_c (f : σ → A) (r : R) : mkDerivationₗ R f (C r) = 0 :=
+theorem mkDerivationₗ_C (f : σ → A) (r : R) : mkDerivationₗ R f (C r) = 0 :=
   (mkDerivationₗ_monomial f _ _).trans (smul_zero _)
-#align mv_polynomial.mk_derivationₗ_C MvPolynomial.mkDerivationₗ_c
+#align mv_polynomial.mk_derivationₗ_C MvPolynomial.mkDerivationₗ_C
 
-theorem mkDerivationₗ_x (f : σ → A) (i : σ) : mkDerivationₗ R f (X i) = f i :=
+theorem mkDerivationₗ_X (f : σ → A) (i : σ) : mkDerivationₗ R f (X i) = f i :=
   (mkDerivationₗ_monomial f _ _).trans <| by simp
-#align mv_polynomial.mk_derivationₗ_X MvPolynomial.mkDerivationₗ_x
+#align mv_polynomial.mk_derivationₗ_X MvPolynomial.mkDerivationₗ_X
 
 @[simp]
-theorem derivation_c (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a) = 0 :=
+theorem derivation_C (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a) = 0 :=
   D.map_algebraMap a
-#align mv_polynomial.derivation_C MvPolynomial.derivation_c
+#align mv_polynomial.derivation_C MvPolynomial.derivation_C
 
 @[simp]
-theorem derivation_c_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
+theorem derivation_C_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
     D (C a * f) = a • D f := by rw [C_mul', D.map_smul]
-#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_c_mul
+#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_C_mul
 
 /-- If two derivations agree on `X i`, `i ∈ s`, then they agree on all polynomials from
 `mv_polynomial.supported R s`. -/
@@ -94,7 +99,7 @@ theorem derivation_ext {D₁ D₂ : Derivation R (MvPolynomial σ R) A} (h : ∀
 
 variable [IsScalarTower R (MvPolynomial σ R) A]
 
-theorem leibniz_iff_x (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
+theorem leibniz_iff_X (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
     (∀ p q, D (p * q) = p • D q + q • D p) ↔
       ∀ s i,
         D (monomial s 1 * X i) =
@@ -118,17 +123,18 @@ theorem leibniz_iff_x (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
   case h_add q₁ q₂ h₁ h₂ => simp only [mul_add, map_add, h₁, h₂, smul_add, add_smul]; abel
   case h_X q i hq =>
     simp only [this, ← mul_assoc, hq, mul_smul, smul_add, smul_comm (X i), add_assoc]
-#align mv_polynomial.leibniz_iff_X MvPolynomial.leibniz_iff_x
+#align mv_polynomial.leibniz_iff_X MvPolynomial.leibniz_iff_X
 
 variable (R)
 
+#print MvPolynomial.mkDerivation /-
 /-- The derivation on `mv_polynomial σ R` that takes value `f i` on `X i`. -/
 def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
     where
   toLinearMap := mkDerivationₗ R f
-  map_one_eq_zero' := mkDerivationₗ_c _ 1
+  map_one_eq_zero' := mkDerivationₗ_C _ 1
   leibniz' :=
-    (leibniz_iff_x (mkDerivationₗ R f) (mkDerivationₗ_c _ 1)).2 fun s i =>
+    (leibniz_iff_X (mkDerivationₗ R f) (mkDerivationₗ_C _ 1)).2 fun s i =>
       by
       simp only [mk_derivationₗ_monomial, X, monomial_mul, one_smul, one_mul]
       rw [Finsupp.sum_add_index'] <;> [skip; · simp;
@@ -140,11 +146,12 @@ def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
       rw [smul_smul, monomial_mul, one_mul, add_comm s, add_tsub_assoc_of_le]
       rwa [Finsupp.single_le_iff, Nat.succ_le_iff, pos_iff_ne_zero, ← Finsupp.mem_support_iff]
 #align mv_polynomial.mk_derivation MvPolynomial.mkDerivation
+-/
 
 @[simp]
-theorem mkDerivation_x (f : σ → A) (i : σ) : mkDerivation R f (X i) = f i :=
-  mkDerivationₗ_x f i
-#align mv_polynomial.mk_derivation_X MvPolynomial.mkDerivation_x
+theorem mkDerivation_X (f : σ → A) (i : σ) : mkDerivation R f (X i) = f i :=
+  mkDerivationₗ_X f i
+#align mv_polynomial.mk_derivation_X MvPolynomial.mkDerivation_X
 
 theorem mkDerivation_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
     mkDerivation R f (monomial s r) =
@@ -159,8 +166,8 @@ def mkDerivationEquiv : (σ → A) ≃ₗ[R] Derivation R (MvPolynomial σ R) A
       toFun := fun D i => D (X i)
       map_add' := fun D₁ D₂ => rfl
       map_smul' := fun c D => rfl
-      left_inv := fun D => derivation_ext <| mkDerivation_x _ _
-      right_inv := fun f => funext <| mkDerivation_x _ _ }
+      left_inv := fun D => derivation_ext <| mkDerivation_X _ _
+      right_inv := fun f => funext <| mkDerivation_X _ _ }
 #align mv_polynomial.mk_derivation_equiv MvPolynomial.mkDerivationEquiv
 
 end MvPolynomial
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module data.mv_polynomial.derivation
-! leanprover-community/mathlib commit 6e492fdbed778ea815798a5a0c6cb83df8486265
+! leanprover-community/mathlib commit b608348ffaeb7f557f2fd46876037abafd326ff3
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Data.MvPolynomial.Supported
-import Mathbin.RingTheory.Derivation
+import Mathbin.RingTheory.Derivation.Basic
 
 /-!
 # Derivations of multivariate polynomials
Diff
@@ -131,9 +131,9 @@ def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
     (leibniz_iff_x (mkDerivationₗ R f) (mkDerivationₗ_c _ 1)).2 fun s i =>
       by
       simp only [mk_derivationₗ_monomial, X, monomial_mul, one_smul, one_mul]
-      rw [Finsupp.sum_add_index'] <;>
-        [skip;· simp;· intros ; simp only [Nat.cast_add, (monomial _).map_add, add_smul]]
-      rw [Finsupp.sum_single_index, Finsupp.sum_single_index] <;> [skip;· simp;· simp]
+      rw [Finsupp.sum_add_index'] <;> [skip; · simp;
+        · intros; simp only [Nat.cast_add, (monomial _).map_add, add_smul]]
+      rw [Finsupp.sum_single_index, Finsupp.sum_single_index] <;> [skip; · simp; · simp]
       rw [tsub_self, add_tsub_cancel_right, Nat.cast_one, ← C_apply, C_1, one_smul, add_comm,
         Finsupp.smul_sum]
       refine' congr_arg₂ (· + ·) rfl (Finset.sum_congr rfl fun j hj => _); dsimp only
Diff
@@ -23,7 +23,7 @@ builds a derivation from its values on `X i`s and a linear equivalence
 
 namespace MvPolynomial
 
-open BigOperators
+open scoped BigOperators
 
 noncomputable section
 
Diff
@@ -102,9 +102,7 @@ theorem leibniz_iff_x (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
             (X i : MvPolynomial σ R) • D (monomial s 1) :=
   by
   refine' ⟨fun H p i => H _ _, fun H => _⟩
-  have hC : ∀ r, D (C r) = 0 := by
-    intro r
-    rw [C_eq_smul_one, D.map_smul, h₁, smul_zero]
+  have hC : ∀ r, D (C r) = 0 := by intro r; rw [C_eq_smul_one, D.map_smul, h₁, smul_zero]
   have : ∀ p i, D (p * X i) = p • D (X i) + (X i : MvPolynomial σ R) • D p :=
     by
     intro p i
@@ -134,9 +132,7 @@ def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
       by
       simp only [mk_derivationₗ_monomial, X, monomial_mul, one_smul, one_mul]
       rw [Finsupp.sum_add_index'] <;>
-        [skip;· simp;·
-          intros
-          simp only [Nat.cast_add, (monomial _).map_add, add_smul]]
+        [skip;· simp;· intros ; simp only [Nat.cast_add, (monomial _).map_add, add_smul]]
       rw [Finsupp.sum_single_index, Finsupp.sum_single_index] <;> [skip;· simp;· simp]
       rw [tsub_self, add_tsub_cancel_right, Nat.cast_one, ← C_apply, C_1, one_smul, add_comm,
         Finsupp.smul_sum]
Diff
@@ -133,10 +133,11 @@ def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
     (leibniz_iff_x (mkDerivationₗ R f) (mkDerivationₗ_c _ 1)).2 fun s i =>
       by
       simp only [mk_derivationₗ_monomial, X, monomial_mul, one_smul, one_mul]
-      rw [Finsupp.sum_add_index'] <;> [skip, · simp,
-        · intros
+      rw [Finsupp.sum_add_index'] <;>
+        [skip;· simp;·
+          intros
           simp only [Nat.cast_add, (monomial _).map_add, add_smul]]
-      rw [Finsupp.sum_single_index, Finsupp.sum_single_index] <;> [skip, · simp, · simp]
+      rw [Finsupp.sum_single_index, Finsupp.sum_single_index] <;> [skip;· simp;· simp]
       rw [tsub_self, add_tsub_cancel_right, Nat.cast_one, ← C_apply, C_1, one_smul, add_comm,
         Finsupp.smul_sum]
       refine' congr_arg₂ (· + ·) rfl (Finset.sum_congr rfl fun j hj => _); dsimp only
Diff
@@ -50,44 +50,44 @@ theorem mkDerivationₗ_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
   sum_monomial_eq <| LinearMap.map_zero _
 #align mv_polynomial.mk_derivationₗ_monomial MvPolynomial.mkDerivationₗ_monomial
 
-theorem mkDerivationₗ_c (f : σ → A) (r : R) : mkDerivationₗ R f (c r) = 0 :=
+theorem mkDerivationₗ_c (f : σ → A) (r : R) : mkDerivationₗ R f (C r) = 0 :=
   (mkDerivationₗ_monomial f _ _).trans (smul_zero _)
 #align mv_polynomial.mk_derivationₗ_C MvPolynomial.mkDerivationₗ_c
 
-theorem mkDerivationₗ_x (f : σ → A) (i : σ) : mkDerivationₗ R f (x i) = f i :=
+theorem mkDerivationₗ_x (f : σ → A) (i : σ) : mkDerivationₗ R f (X i) = f i :=
   (mkDerivationₗ_monomial f _ _).trans <| by simp
 #align mv_polynomial.mk_derivationₗ_X MvPolynomial.mkDerivationₗ_x
 
 @[simp]
-theorem derivation_c (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (c a) = 0 :=
+theorem derivation_c (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a) = 0 :=
   D.map_algebraMap a
 #align mv_polynomial.derivation_C MvPolynomial.derivation_c
 
 @[simp]
 theorem derivation_c_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
-    D (c a * f) = a • D f := by rw [C_mul', D.map_smul]
+    D (C a * f) = a • D f := by rw [C_mul', D.map_smul]
 #align mv_polynomial.derivation_C_mul MvPolynomial.derivation_c_mul
 
 /-- If two derivations agree on `X i`, `i ∈ s`, then they agree on all polynomials from
 `mv_polynomial.supported R s`. -/
 theorem derivation_eqOn_supported {D₁ D₂ : Derivation R (MvPolynomial σ R) A} {s : Set σ}
-    (h : Set.EqOn (D₁ ∘ x) (D₂ ∘ x) s) {f : MvPolynomial σ R} (hf : f ∈ supported R s) :
+    (h : Set.EqOn (D₁ ∘ X) (D₂ ∘ X) s) {f : MvPolynomial σ R} (hf : f ∈ supported R s) :
     D₁ f = D₂ f :=
   Derivation.eqOn_adjoin (Set.ball_image_iff.2 h) hf
 #align mv_polynomial.derivation_eq_on_supported MvPolynomial.derivation_eqOn_supported
 
 theorem derivation_eq_of_forall_mem_vars {D₁ D₂ : Derivation R (MvPolynomial σ R) A}
-    {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D₁ (x i) = D₂ (x i)) : D₁ f = D₂ f :=
+    {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D₁ (X i) = D₂ (X i)) : D₁ f = D₂ f :=
   derivation_eqOn_supported h f.mem_supported_vars
 #align mv_polynomial.derivation_eq_of_forall_mem_vars MvPolynomial.derivation_eq_of_forall_mem_vars
 
 theorem derivation_eq_zero_of_forall_mem_vars {D : Derivation R (MvPolynomial σ R) A}
-    {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D (x i) = 0) : D f = 0 :=
+    {f : MvPolynomial σ R} (h : ∀ i ∈ f.vars, D (X i) = 0) : D f = 0 :=
   show D f = (0 : Derivation R (MvPolynomial σ R) A) f from derivation_eq_of_forall_mem_vars h
 #align mv_polynomial.derivation_eq_zero_of_forall_mem_vars MvPolynomial.derivation_eq_zero_of_forall_mem_vars
 
 @[ext]
-theorem derivation_ext {D₁ D₂ : Derivation R (MvPolynomial σ R) A} (h : ∀ i, D₁ (x i) = D₂ (x i)) :
+theorem derivation_ext {D₁ D₂ : Derivation R (MvPolynomial σ R) A} (h : ∀ i, D₁ (X i) = D₂ (X i)) :
     D₁ = D₂ :=
   Derivation.ext fun f => derivation_eq_of_forall_mem_vars fun i _ => h i
 #align mv_polynomial.derivation_ext MvPolynomial.derivation_ext
@@ -97,9 +97,9 @@ variable [IsScalarTower R (MvPolynomial σ R) A]
 theorem leibniz_iff_x (D : MvPolynomial σ R →ₗ[R] A) (h₁ : D 1 = 0) :
     (∀ p q, D (p * q) = p • D q + q • D p) ↔
       ∀ s i,
-        D (monomial s 1 * x i) =
-          (monomial s 1 : MvPolynomial σ R) • D (x i) +
-            (x i : MvPolynomial σ R) • D (monomial s 1) :=
+        D (monomial s 1 * X i) =
+          (monomial s 1 : MvPolynomial σ R) • D (X i) +
+            (X i : MvPolynomial σ R) • D (monomial s 1) :=
   by
   refine' ⟨fun H p i => H _ _, fun H => _⟩
   have hC : ∀ r, D (C r) = 0 := by
@@ -145,7 +145,7 @@ def mkDerivation (f : σ → A) : Derivation R (MvPolynomial σ R) A
 #align mv_polynomial.mk_derivation MvPolynomial.mkDerivation
 
 @[simp]
-theorem mkDerivation_x (f : σ → A) (i : σ) : mkDerivation R f (x i) = f i :=
+theorem mkDerivation_x (f : σ → A) (i : σ) : mkDerivation R f (X i) = f i :=
   mkDerivationₗ_x f i
 #align mv_polynomial.mk_derivation_X MvPolynomial.mkDerivation_x
 
@@ -159,7 +159,7 @@ theorem mkDerivation_monomial (f : σ → A) (s : σ →₀ ℕ) (r : R) :
 def mkDerivationEquiv : (σ → A) ≃ₗ[R] Derivation R (MvPolynomial σ R) A :=
   LinearEquiv.symm <|
     { invFun := mkDerivation R
-      toFun := fun D i => D (x i)
+      toFun := fun D i => D (X i)
       map_add' := fun D₁ D₂ => rfl
       map_smul' := fun c D => rfl
       left_inv := fun D => derivation_ext <| mkDerivation_x _ _

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,7 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathlib.Data.MvPolynomial.Supported
+import Mathlib.Algebra.MvPolynomial.Supported
 import Mathlib.RingTheory.Derivation.Basic
 
 #align_import data.mv_polynomial.derivation from "leanprover-community/mathlib"@"b608348ffaeb7f557f2fd46876037abafd326ff3"
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -74,7 +74,7 @@ theorem derivation_C_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : M
 theorem derivation_eqOn_supported {D₁ D₂ : Derivation R (MvPolynomial σ R) A} {s : Set σ}
     (h : Set.EqOn (D₁ ∘ X) (D₂ ∘ X) s) {f : MvPolynomial σ R} (hf : f ∈ supported R s) :
     D₁ f = D₂ f :=
-  Derivation.eqOn_adjoin (Set.ball_image_iff.2 h) hf
+  Derivation.eqOn_adjoin (Set.forall_mem_image.2 h) hf
 #align mv_polynomial.derivation_eq_on_supported MvPolynomial.derivation_eqOn_supported
 
 theorem derivation_eq_of_forall_mem_vars {D₁ D₂ : Derivation R (MvPolynomial σ R) A}
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
@@ -24,7 +24,7 @@ open scoped BigOperators
 
 noncomputable section
 
-variable {σ R A : Type _} [CommSemiring R] [AddCommMonoid A] [Module R A]
+variable {σ R A : Type*} [CommSemiring R] [AddCommMonoid A] [Module R A]
   [Module (MvPolynomial σ R) A]
 
 section
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
@@ -63,17 +63,11 @@ theorem derivation_C (D : Derivation R (MvPolynomial σ R) A) (a : R) : D (C a)
 set_option linter.uppercaseLean3 false in
 #align mv_polynomial.derivation_C MvPolynomial.derivation_C
 
--- @[simp] -- Porting note: simp normal form is `derivation_C_mul'`
-theorem derivation_C_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
-    D (C a * f) = a • D f := by rw [C_mul', D.map_smul]
-set_option linter.uppercaseLean3 false in
-#align mv_polynomial.derivation_C_mul MvPolynomial.derivation_C_mul
-
 @[simp]
-theorem derivation_C_mul' (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
+theorem derivation_C_mul (D : Derivation R (MvPolynomial σ R) A) (a : R) (f : MvPolynomial σ R) :
     C (σ := σ) a • D f = a • D f := by
   have : C (σ := σ) a • D f = D (C a * f) := by simp
-  rw [this, derivation_C_mul]
+  rw [this, C_mul', D.map_smul]
 
 /-- If two derivations agree on `X i`, `i ∈ s`, then they agree on all polynomials from
 `MvPolynomial.supported R s`. -/
fix: MvPolynomial.Derivation module docstring (#6025)
Diff
@@ -14,7 +14,7 @@ import Mathlib.RingTheory.Derivation.Basic
 In this file we prove that a derivation of `MvPolynomial σ R` is determined by its values on all
 monomials `MvPolynomial.X i`. We also provide a constructor `MvPolynomial.mkDerivation` that
 builds a derivation from its values on `X i`s and a linear equivalence
-`MvPolynomial.equivDerivation` between `σ → A` and `Derivation (MvPolynomial σ R) A`.
+`MvPolynomial.mkDerivationEquiv` between `σ → A` and `Derivation (MvPolynomial σ R) A`.
 -/
 
 
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) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module data.mv_polynomial.derivation
-! leanprover-community/mathlib commit b608348ffaeb7f557f2fd46876037abafd326ff3
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.MvPolynomial.Supported
 import Mathlib.RingTheory.Derivation.Basic
 
+#align_import data.mv_polynomial.derivation from "leanprover-community/mathlib"@"b608348ffaeb7f557f2fd46876037abafd326ff3"
+
 /-!
 # Derivations of multivariate polynomials
 
feat: port Data.MvPolynomial.Derivation (#4603)

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

Dependencies 8 + 468

469 files ported (98.3%)
193820 lines ported (98.4%)
Show graph

The unported dependencies are