@@ -432,13 +432,49 @@ theorem leibniz_invOf [Invertible a] : D (⅟ a) = -⅟ a ^ 2 • D a :=
432
432
D.leibniz_of_mul_eq_one <| invOf_mul_self a
433
433
#align derivation.leibniz_inv_of Derivation.leibniz_invOf
434
434
435
- theorem leibniz_inv {K : Type *} [Field K] [Module K M] [Algebra R K] (D : Derivation R K M)
436
- (a : K) : D a⁻¹ = -a⁻¹ ^ 2 • D a := by
435
+ section Field
436
+
437
+ variable {K : Type *} [Field K] [Module K M] [Algebra R K] (D : Derivation R K M)
438
+
439
+ theorem leibniz_inv (a : K) : D a⁻¹ = -a⁻¹ ^ 2 • D a := by
437
440
rcases eq_or_ne a 0 with (rfl | ha)
438
441
· simp
439
442
· exact D.leibniz_of_mul_eq_one (inv_mul_cancel ha)
440
443
#align derivation.leibniz_inv Derivation.leibniz_inv
441
444
445
+ theorem leibniz_div (a b : K) : D (a / b) = b⁻¹ ^ 2 • (b • D a - a • D b) := by
446
+ simp only [div_eq_mul_inv, leibniz, leibniz_inv, inv_pow, neg_smul, smul_neg, smul_smul, add_comm,
447
+ sub_eq_add_neg, smul_add]
448
+ rw [← inv_mul_mul_self b⁻¹, inv_inv]
449
+ ring_nf
450
+
451
+ theorem leibniz_div_const (a b : K) (h : D b = 0 ) : D (a / b) = b⁻¹ • D a := by
452
+ simp only [leibniz_div, inv_pow, h, smul_zero, sub_zero, smul_smul]
453
+ rw [← mul_self_mul_inv b⁻¹, inv_inv]
454
+ ring_nf
455
+
456
+ lemma leibniz_zpow (a : K) (n : ℤ) : D (a ^ n) = n • a ^ (n - 1 ) • D a := by
457
+ by_cases hn : n = 0
458
+ · simp [hn]
459
+ by_cases ha : a = 0
460
+ · simp [ha, zero_zpow n hn]
461
+ rcases Int.natAbs_eq n with h | h
462
+ · rw [h]
463
+ simp only [zpow_natCast, leibniz_pow, natCast_zsmul]
464
+ rw [← zpow_natCast]
465
+ congr
466
+ omega
467
+ · rw [h, zpow_neg, zpow_natCast, leibniz_inv, leibniz_pow, inv_pow, ← pow_mul, ← zpow_natCast,
468
+ ← zpow_natCast, nsmul_eq_smul_cast K, zsmul_eq_smul_cast K, smul_smul, smul_smul, smul_smul]
469
+ trans (-n.natAbs * (a ^ ((n.natAbs - 1 : ℕ) : ℤ) / (a ^ ((n.natAbs * 2 : ℕ) : ℤ)))) • D a
470
+ · ring_nf
471
+ rw [← zpow_sub₀ ha]
472
+ congr 3
473
+ · norm_cast
474
+ omega
475
+
476
+ end Field
477
+
442
478
instance : Neg (Derivation R A M) :=
443
479
⟨fun D =>
444
480
mk' (-D) fun a b => by
0 commit comments