Skip to content

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

Open
pariandrea wants to merge 1 commit into
leanprover-community:masterfrom
pariandrea:susy
Open

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

Conversation

@pariandrea
Copy link
Copy Markdown

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ⁿ.

Copy link
Copy Markdown
Member

@jstoobysmith jstoobysmith left a comment

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
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
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
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
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
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
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
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
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 ... ....

…r potential & metric

Multivariable Wirtinger calculus and the N=1 chiral scalar sector built on it.

* Mathematics/Calculus/Wirtinger: directional holomorphic/anti-holomorphic
  operators over a complex space, the full calculus (linearity, Leibniz,
  chain rule, conjugations, holomorphic collapse) and Schwarz's theorem via
  ContDiffAt.isSymmSndFDerivAt.
* SUSY/N1/Basic: ChiralIndex, the physical configuration space WirtingerInput,
  and the antiChiral derived view.
* SUSY/N1/Deriv: scalar Wirtinger derivatives ∂_I, ∂̄_I as specializations.
* SUSY/N1/KahlerPotential + KahlerMetric: ℝ-valued Kähler potential and the
  hermitian metric g_{i j̄} = ∂_i ∂_{j̄} K via Schwarz's theorem.
* SUSY/N1/LogKahlerHn + UpperHalfPlane: the multi-field upper-half-plane log
  Kähler model with positive-definite Poincaré metric.
* SUSY/N1/SuperPotential: abstract holomorphic superpotential.

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