/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import Mathlib.Analysis.Complex.Basic import Mathlib.Tactic.Ring

Multiplicative derivatives

This file defines the multiplicative derivative of a complex-valued function on an additive group and proves its basic identities.

@[expose] public section

The multiplicative derivative $\Delta_h f(x) = f(x) \overline{f(x+h)}$.

noncomputable def multiplicativeDerivative {G : Type*} [AddGroup G] (h : G) (f : G → ℂ) : G → ℂ := fun x ↦ f x * star (f (x + h))variable {G : Type*} [AddCommGroup G]

The derivative with step zero is the function multiplied by its conjugate.

lemma multiplicativeDerivative_zero (f : G → ℂ) (x : G) : multiplicativeDerivative 0 f x = f x * star (f x) := G:Type u_1inst✝:AddCommGroup Gf:G → ℂx:G⊢ multiplicativeDerivative 0 f x = f x * star (f x) All goals completed! 🐙

The multiplicative derivative of a constant function is constant.

lemma multiplicativeDerivative_const (h : G) (c : ℂ) (x : G) : multiplicativeDerivative h (fun _ ↦ c) x = c * star c := G:Type u_1inst✝:AddCommGroup Gh:Gc:ℂx:G⊢ multiplicativeDerivative h (fun x ↦ c) x = c * star c All goals completed! 🐙

The multiplicative derivative is invariant under translation of the input function.

lemma multiplicativeDerivative_add_right (h : G) (f : G → ℂ) (x y : G) : multiplicativeDerivative h (fun z ↦ f (z + y)) x = multiplicativeDerivative h f (x + y) := G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂx:Gy:G⊢ multiplicativeDerivative h (fun z ↦ f (z + y)) x = multiplicativeDerivative h f (x + y) All goals completed! 🐙

The multiplicative derivative distributes over the product of two functions.

lemma multiplicativeDerivative_mul (h : G) (f g : G → ℂ) : multiplicativeDerivative h (f * g) = multiplicativeDerivative h f * multiplicativeDerivative h g := G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂg:G → ℂ⊢ multiplicativeDerivative h (f * g) = multiplicativeDerivative h f * multiplicativeDerivative h g G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂg:G → ℂx:G⊢ multiplicativeDerivative h (f * g) x = (multiplicativeDerivative h f * multiplicativeDerivative h g) x G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂg:G → ℂx:G⊢ f x * g x * (star (g (x + h)) * star (f (x + h))) = f x * star (f (x + h)) * (g x * star (g (x + h))) All goals completed! 🐙

The multiplicative derivative of a conjugated function.

lemma multiplicativeDerivative_star (h : G) (f : G → ℂ) (x : G) : multiplicativeDerivative h (star f) x = star (f x) * f (x + h) := G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂx:G⊢ multiplicativeDerivative h (star f) x = star (f x) * f (x + h) All goals completed! 🐙

A negative step is obtained by conjugating and translating a positive step.

lemma multiplicativeDerivative_neg_add (h : G) (f : G → ℂ) (x : G) : multiplicativeDerivative (-h) f (x + h) = star (multiplicativeDerivative h f x) := G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂx:G⊢ multiplicativeDerivative (-h) f (x + h) = star (multiplicativeDerivative h f x) G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂx:G⊢ f (x + h) * (starRingEnd ℂ) (f x) = (starRingEnd ℂ) (f x) * f (x + h) All goals completed! 🐙

Iterated multiplicative derivatives commute.

lemma multiplicativeDerivative_comm (h1 h2 : G) (f : G → ℂ) : multiplicativeDerivative h1 (multiplicativeDerivative h2 f) = multiplicativeDerivative h2 (multiplicativeDerivative h1 f) := G:Type u_1inst✝:AddCommGroup Gh1:Gh2:Gf:G → ℂ⊢ multiplicativeDerivative h1 (multiplicativeDerivative h2 f) = multiplicativeDerivative h2 (multiplicativeDerivative h1 f) G:Type u_1inst✝:AddCommGroup Gh1:Gh2:Gf:G → ℂx:G⊢ multiplicativeDerivative h1 (multiplicativeDerivative h2 f) x = multiplicativeDerivative h2 (multiplicativeDerivative h1 f) x G:Type u_1inst✝:AddCommGroup Gh1:Gh2:Gf:G → ℂx:G⊢ f x * (starRingEnd ℂ) (f (x + h2)) * ((starRingEnd ℂ) (f (x + h1)) * f (x + h1 + h2)) = f x * (starRingEnd ℂ) (f (x + h1)) * ((starRingEnd ℂ) (f (x + h2)) * f (x + h1 + h2)) All goals completed! 🐙

The multiplicative derivative of a linear phase (a unitary character) is a constant function. This captures the property that taking the derivative of a phase annihilates the variable x.

All goals completed! 🐙 _ = star (f h) := G:Type u_1inst✝:AddCommGroup Gh:Gf:G → ℂh_add:∀ (a b : G), f (a + b) = f a * f bh_unit:∀ (a : G), f a * star (f a) = 1x:G⊢ 1 * star (f h) = star (f h) All goals completed! 🐙