Skip to content

feat: Wirtinger calculus and N=1 SUSY scalar Wirtinger derivatives#1107

Open
pariandrea wants to merge 7 commits into
leanprover-community:masterfrom
pariandrea:susy
Open

feat: Wirtinger calculus and N=1 SUSY scalar Wirtinger derivatives#1107
pariandrea wants to merge 7 commits into
leanprover-community:masterfrom
pariandrea:susy

Conversation

@pariandrea

Copy link
Copy Markdown
Contributor

Summary

Adds a reusable Wirtinger calculus for ℂ → ℂ functions, and builds on it
the N=1 SUSY scalar Wirtinger derivatives ∂/∂φ^I and ∂/∂φ̄^I on the
chiral configuration space. The change is purely additive — 11 new files, no
existing code modified (aside from registering the modules in Physlib.lean).

What this adds

Physlib/Mathematics/Calculus/Wirtinger/ — a general 1-D Wirtinger calculus:

  • dWirtinger / dWirtingerBar, the operators (1/2)(∂_x ∓ i∂_y);
  • their collapse to the complex derivative on holomorphic functions and the
    real-linear Wirtinger decomposition;
  • the differentiation rules — locality, real-linearity, the Leibniz rule, the
    two-term chain rule, conjugation lemmas;
  • an outer-function derivative catalog (Complex.log, …).

Physlib/SUSY/N1/ — the N=1 scalar sector:

  • ChiralScalarValue n = Fin n → ℂ, the physical configuration space, with the
    anti-chiral view as a derived conjugation;
  • dScalar / dScalarBar, the scalar Wirtinger operators, defined as the 1-D
    operators applied through a coordinate slice;
  • their calculus — coordinate rules ∂φ^J/∂φ^I = δ_IJ, additivity, the Leibniz
    rule, the holomorphic/antiholomorphic collapse, and the outer chain rules.

Worked example

SUSY/N1/Examples.lean computes, in closed form, the chiral and anti-chiral
Wirtinger derivatives of the multi-field upper-half-plane log Kähler potential
K = -∑_I log(i(z̄^I − z^I)), and from them the Kähler metric
g_{IJ̄} = -δ_{IJ}/(z^I − z̄^I)² — the Poincaré metric on Hⁿ.

@jstoobysmith jstoobysmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - some comments to help improve this.

namespace Physlib

/-- Restrict a complex 1-D Fréchet derivative on `ℂ → ℂ` to `ℝ`-scalars. -/
lemma hasFDerivAt_restrictScalarsℝℂ {f : ℂ → ℂ} {f' : ℂ →L[ℂ] ℂ}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to use HasFDerivAt.restrictScalars directly somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not possible because the inference of the arguments does not work. They need to be provided manually.

@@ -0,0 +1,116 @@
/-
Copyright (c) 2026 The Physlib Contributors. All rights reserved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Physlib Contributors should be your name throughout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

/-!

# Wirtinger operators on `ℂ → ℂ` and the Wirtinger decomposition

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a bit more detail on what the Wirtinger operators are.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded the Overview section.


/-- The real Fréchet derivative of `Complex.log` at a slit-plane point,
packaged as a `HasFDerivAt` statement over `ℝ`. -/
lemma hasFDerivAt_real_log {z : ℂ} (hz : z ∈ Complex.slitPlane) :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I.e. could we use hasFDerivAt_restrictScalarsℝℂ directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not necessary. removed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lemmas.lean would probably be a better title here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread Physlib/SUSY/N1/Basic.lean Outdated

## i. Overview

In this module we introduce the minimal label and configuration data for the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some additional context here would be nice e.g. what is missing, and how this fits into the big picture.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded the overview

Comment thread Physlib/SUSY/N1/CLM.lean Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can likely go in the Basic.lean file.

Comment thread Physlib/SUSY/N1/Deriv.lean Outdated

-/

namespace dScalar

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be a namespace, similar elsewhere.

Comment thread Physlib/SUSY/N1/Examples.lean Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would try and extract useful results from this into their own files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reusable lemmas moved into Kahler.lean/Deriv.lean. Examples.lean is now
a demo with only examples and #checks. This is a specific example of potential which shows that the infrastructure works. Expanding from here will help me understand what is actually reusable and what is specific to the calculation of a certain potential.

Comment thread Physlib/SUSY/N1/OuterDeriv.lean Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could likely be merged with the Deriv file.

pariandrea added a commit to pariandrea/physlib that referenced this pull request May 19, 2026
… feedback

- Rename Wirtinger/Rules.lean to Lemmas.lean
- Remove the Wirtinger.lean re-export aggregator; Physlib.lean imports the
  four leaf modules directly
- Merge SUSY/N1/CLM.lean into SUSY/N1/Basic.lean
- Merge SUSY/N1/OuterDeriv.lean into SUSY/N1/Deriv.lean
- Flatten the dScalar / dScalarBar namespaces: lemmas are now dScalar_foo
  rather than dScalar.foo
- Extract the H^n log Kähler potential and its Kähler metric into the new
  SUSY/N1/Kahler.lean; reduce Examples.lean to a runnable demo
- Expand the Wirtinger-operator explanation in Complex.lean and the
  big-picture context in SUSY/N1/Basic.lean
- Set copyright headers to the author's name

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pariandrea added a commit to pariandrea/physlib that referenced this pull request May 19, 2026
Resolve the two `Style linters` CI failures on PR leanprover-community#1107:

- check_file_imports: move the `SUSY.N1.*` import block to its
  sorted position (before `SpaceAndTime.*`) in `Physlib.lean`.
- simpNF: drop `@[simp]` from `dWirtinger_star`, `dWirtingerBar_star`,
  `dScalar_antiChiralCoord`, and `dScalarBar_antiChiralCoord`. Their
  left-hand sides contain `star`/`antiChiral`, which simp normalises to
  `starRingEnd ℂ` before the lemma could fire, so they were never valid
  simp lemmas. All call sites use them explicitly via `rw`/`simp only`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pariandrea added a commit to pariandrea/physlib that referenced this pull request May 19, 2026
Note the `IsScalarTower ℝ ℂ ℂ` instance diamond (the `Algebra` vs
`NormedSpace.complexToReal` route to `SMul ℝ ℂ`) behind
`hasFDerivAt_restrictScalarsℝℂ`, with a commented-out `example` that
reproduces the synthesis failure. Addresses PR leanprover-community#1107 review feedback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pariandrea added a commit to pariandrea/physlib that referenced this pull request May 19, 2026
….lean

`hasFDerivAt_real_log` was a one-line wrapper around
`hasFDerivAt_restrictScalarsℝℂ`, used once and only for its differentiability
corollary. Inline it at the call site in Kahler.lean and remove the
now-empty OuterFunctions.lean. Addresses PR leanprover-community#1107 review feedback.

Also expand the Wirtinger folder overview in Basic.lean (motivation, folder
layout, conventions) — recovering content from the deleted Wirtinger.lean
aggregator.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jstoobysmith jstoobysmith self-assigned this May 20, 2026
@pariandrea pariandrea requested a review from jstoobysmith May 20, 2026 14:25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we start with a PR which is just this file - I think this will make the process a lot quicker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. Should i make a new branch and a new PR ? Or is there a quicker way?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably easiest to make a new branch and then use (I think) git checkout ... ....

pariandrea and others added 7 commits June 9, 2026 14:59
Adds the Wirtinger calculus on finite-index complex coordinate spaces
`ι → ℂ` in `Physlib/Mathematics/Calculus/Wirtinger/`:

* `Basic.lean` — coordinate-basis CLMs and complex conjugation on `ι → ℂ`.
* `Multivariable.lean` — the multivariable holomorphic / anti-holomorphic
  Wirtinger derivatives `dWirtingerDir` and their calculus.
* `Coordinate.lean` — the coordinate operators `dWirtingerCoord` /
  `dWirtingerAntiCoord`, the Leibniz rule, and Schwarz's theorem.
* `UpperHalfPlane.lean` — reusable upper-half-plane Wirtinger lemmas.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…uperpotential

Builds the N=1 chiral scalar sector on the coordinate Wirtinger calculus:

* `Basic.lean` — the `Model` indexing data and the chiral configuration type
  `ChiralScalarConfiguration` (the no-doubling design: the only field data is
  the chiral configuration; anti-chiral scalars are its conjugates).
* `Derivative.lean` — the chiral / anti-chiral derivative wrappers
  `M.dChiralScalar` / `M.dAntiChiralScalar` over the Wirtinger operators.
* `SuperPotential.lean` — the holomorphic superpotential `W` and its conjugate.
* `KahlerPotential.lean` — the abstract Kähler potential `K`.
* `KahlerMetric.lean` — the Kähler metric `g_{IJ̄} = ∂_I ∂_J̄ K` and hermiticity.
* `LogKahlerHn.lean` — worked example: the `Hⁿ` log Kähler potential.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…erview

Rework the module docstrings onto a single notation convention:
- total real directional derivative `df(d)`, Wirtinger parts `∂f(d)`/`∂̄f(d)`,
  all in applied form; genuine coordinate partials (`∂f/∂x`, `∂g/∂z`) stay fractions
- consolidate the conventions into a dedicated Notation paragraph; frame the
  split `df(d) = ∂f(d) + ∂̄f(d)` as the directional `d = ∂ + ∂̄` (Dolbeault) splitting
- retire the `Df(·)` and `∂_d f` variants; `∂_d ∂_ē f` kept only as operator
  shorthand for the iterated Schwarz statement
- tighten the overview (clearer ℝ/ℂ-linearity argument, drop blank-line gaps,
  unambiguous Dolbeault wording)

Docstring/comment-only; no definitions or proofs changed. Build (2080 jobs) and
style lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ed frame

`d` is a general complex vector, so `(d, i·d)` points in `d`'s own direction and
is a rotated *and rescaled* copy of the `(1, i)` axes — not `d` on the real axis
with `i·d` on the imaginary axis. Reword to avoid that misreading.

Comment-only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n renamed v

Overhaul the module's directional-derivative notation so the direction is a
subscript, not a parenthesised argument — `∂_v f` reads as "the ∂-derivative in
direction v of f", removing the `∂f(d)`/`f(d)` misread where the direction looked
like f's argument.

- code binders renamed to match the notation: direction `d → v`, `e → w`, and the
  base-point bound variable `v → p` (proofs unchanged — pure α-renaming, build
  re-verified; `Coordinate.lean` downstream build clean).
- total real directional derivative `d_v f`, Wirtinger parts `∂_v f`, `∂̄_v f`
  (straight d for the total, ∂/∂̄ for the parts; directional Dolbeault d = ∂ + ∂̄).
- chain rule keeps Leibniz and Dolbeault in separate lanes: outer one-variable g in
  Leibniz `∂g/∂f`, `∂g/∂f̄` (bar on the variable), inner f directional `∂_v` (bar on
  the operator), with a §C note that the two must not be conflated.
- Schwarz reads as operator composition `∂_v ∂̄_w f = ∂̄_w ∂_v f`; `/∂` fractions kept
  only for genuine V=ℂ coordinate partials (`∂f/∂x`, `∂f/∂z`).

Docstring/notation + binder names only; no definitions or proofs changed. Build
(2080 jobs), downstream Coordinate.lean (2082), and style lint all clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n/chain-rule sections

Documentation-only refinements to the module header and section prose:

- Move Notation to its own un-numbered section ahead of the overview; convert it
  to a bullet list (subscript convention, the three operators, the /∂ variable
  fraction, u/p base-point roles, V = its own tangent space).
- Rewrite the overview into labelled mini-paragraphs (Real derivative, Rotation,
  Holomorphy, Splitting) for quicker reading; introduce z, z̄ at the V = ℂ case
  and keep the general statements coordinate-free.
- Split former §C "Conjugation and the Wirtinger chain rule" into two sections —
  C. Conjugation and D. The Wirtinger chain rule — renumbering D–H to E–I and
  updating all cross-references; add a worked example per conjugation law.
- Tighten the chain-rule intro and the comp/anti-comp docstrings; expand on
  realLinear_apply_eq_wirtinger as the a·w + b·conj w split.
- Add the Wikipedia "Complex differential form" (Dolbeault operators) reference
  as the source of the d = ∂ + ∂̄ / ∂̄ notation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…cstrings

Root the shared notation legend in Basic (the import root): Basic documents only
what it uses (operator subscript vs `/∂`-variable fraction, `f̄`), Multivariable
keeps the foundation-specific notation (directions, fixed `u` vs bound `p`,
iterated composition).

Align Basic's symbols to the subscript convention (`∂_v f`, not `∂f/∂d`; `v` for
direction, since `d` denotes the total real derivative); rename the `fderiv_star_eq`
bound point `v` to `p`. De-dash the prose, drop the stray `g'` and the
differential-`d` overload, cut the chain-rule worked example now that §D carries it,
and tighten the `fderiv_star_eq` docstring.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants