Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Peterfalvi (5.2): integral character maps, difference images R(χ)R(\chi)R(χ), producers

Definition
OddOrder_Peterfalvi_S07_Coherence_DifferenceImage

by burkh4rt · Nov 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

feit-thompsonfinite-groupsgroup-theoryishida-odd-order

Part of the coherence development of Peterfalvi §7, covering (5.2): integral character maps, the difference images R(χ)R(\chi)R(χ) and their producers.

Main definitions: zSpan (the integral span generated by a set of class functions), zSupportedSpan (the part of Z[S]\mathbb{Z}[S]Z[S] supported on AAA), IntegralCharacterMap (an integral linear map between virtual-character lattices), galoisTransport (transport by coefficientwise automorphism), IsIntegralIsometry (the normalized inner-product part of an integral isometry) and CharacterDifferenceImage (the (5.2.d) image data for one character difference).

The bundle also proves 25 supporting lemmas used by later statements.

Definition code
/-
Copyright (c) 2026 Yawara Ishida. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yawara Ishida
-/
-- From github.com/yawara/odd-order @ 20a6fccbb63c (Apache-2.0; LICENSE at that commit):
--   OddOrder/Peterfalvi/S07_Coherence/DifferenceImage.lean
-- Generated for Prove2Me by deleting declarations; the remaining commands are verbatim except:
-- `private` dropped where another file uses the declaration, and a solution's main theorem
-- renamed `_root_.solution` (platform convention).
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_GaloisCharacter
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_RowOrthogonality
import Definitions.Def_OddOrder_GroupTheory_RepresentationTheory_InducedCharacter
import Definitions.Def_OddOrder_Peterfalvi_S06_DadeIsometryCertain
import Mathlib.Algebra.Module.Submodule.LinearMap
import Mathlib.Data.Fin.Tuple.Sort
import Mathlib.LinearAlgebra.Finsupp.LinearCombination

namespace OddOrder.Peterfalvi.S07

open OddOrder.RepresentationTheory

variable {L G : Type*} [Group L] [Group G]

/-- The integral span generated by a set of class functions. -/
def zSpan (S : Set (ClassFunction L ℂ)) : Submodule ℤ (ClassFunction L ℂ) :=
  Submodule.span ℤ S

/-- The part of `Z[S]` supported on `A`.

This is kept as a predicate-shaped set for now, because the `CF(L,A)` complex
submodule and the integral lattice `Z[S]` live over different scalar rings. -/
def zSupportedSpan (S : Set (ClassFunction L ℂ)) (A : Set L) :
    Set (ClassFunction L ℂ) :=
  {φ | φ ∈ zSpan (L := L) S ∧ φ.support ⊆ A}

theorem mem_zSupportedSpan_iff {S : Set (ClassFunction L ℂ)} {A : Set L}
    {φ : ClassFunction L ℂ} :
    φ ∈ zSupportedSpan (L := L) S A ↔
      φ ∈ zSpan (L := L) S ∧ φ.support ⊆ A :=
  Iff.rfl

theorem support_subset_of_mem_zSupportedSpan {S : Set (ClassFunction L ℂ)} {A : Set L}
    {φ : ClassFunction L ℂ} (hφ : φ ∈ zSupportedSpan (L := L) S A) :
    φ.support ⊆ A :=
  hφ.2

theorem zero_mem_zSupportedSpan {S : Set (ClassFunction L ℂ)} {A : Set L} :
    (0 : ClassFunction L ℂ) ∈ zSupportedSpan (L := L) S A := by
  exact ⟨Submodule.zero_mem _, by simp⟩

theorem add_mem_zSupportedSpan {S : Set (ClassFunction L ℂ)} {A : Set L}
    {φ ψ : ClassFunction L ℂ}
    (hφ : φ ∈ zSupportedSpan (L := L) S A)
    (hψ : ψ ∈ zSupportedSpan (L := L) S A) :
    φ + ψ ∈ zSupportedSpan (L := L) S A := by
  constructor
  · exact Submodule.add_mem _ hφ.1 hψ.1
  · intro x hx
    rcases ClassFunction.support_add_subset φ ψ hx with hxφ | hxψ
    · exact hφ.2 hxφ
    · exact hψ.2 hxψ

theorem zSupportedSpan_mono_left {S₁ S : Set (ClassFunction L ℂ)} {A : Set L}
    (hS : S₁ ⊆ S) {φ : ClassFunction L ℂ}
    (hφ : φ ∈ zSupportedSpan (L := L) S₁ A) :
    φ ∈ zSupportedSpan (L := L) S A :=
  ⟨Submodule.span_mono hS hφ.1, hφ.2⟩

/-- **Anchor generation from supported scaled differences.**

If every generator of `S₁` appears in a finite family `χmem`, the distinguished member `χmem i₁`
is in that family, and each scaled difference `χmem i - deg i • χmem i₁` is supported on `A`, then
`ℤ[S₁]` is generated by the supported sublattice `ℤ[S₁,A]` together with the anchor `χmem i₁`.

This is the structural `hSgen` bridge used by the Peterfalvi §8 X-adjoining step: the analytic
input only has to prove support for the degree-matched differences, while this lemma supplies the
module-generation field. -/
theorem span_subset_span_zSupportedSpan_union_anchor_of_scaledDiffs
    {S₁ : Set (ClassFunction L ℂ)} {A : Set L}
    {ι : Type*} {s : Finset ι} {χmem : ι → ClassFunction L ℂ}
    {deg : ι → ℕ} {i₁ : ι}
    (hcover : ∀ x ∈ S₁, ∃ i, i ∈ s ∧ χmem i = x)
    (hi₁ : i₁ ∈ s)
    (hmemS₁ : ∀ i ∈ s, χmem i ∈ S₁)
    (hdiffsupp : ∀ i ∈ s, (χmem i - deg i • χmem i₁).support ⊆ A) :
    Submodule.span ℤ S₁ ≤
      Submodule.span ℤ (zSupportedSpan (L := L) S₁ A ∪ {χmem i₁}) := by
  set R : Set (ClassFunction L ℂ) := zSupportedSpan (L := L) S₁ A ∪ {χmem i₁} with hR
  refine Submodule.span_le.mpr ?_
  intro x hx
  obtain ⟨i, hi, rfl⟩ := hcover x hx
  have hdiff_zsupp : χmem i - deg i • χmem i₁ ∈ zSupportedSpan (L := L) S₁ A := by
    refine mem_zSupportedSpan_iff.mpr ⟨?_, hdiffsupp i hi⟩
    exact Submodule.sub_mem _ (Submodule.subset_span (hmemS₁ i hi))
      (nsmul_mem (Submodule.subset_span (hmemS₁ i₁ hi₁)) (deg i))
  have hdiff_R : χmem i - deg i • χmem i₁ ∈ Submodule.span ℤ R :=
    Submodule.subset_span (by rw [hR]; left; exact hdiff_zsupp)
  have hanchor_R : χmem i₁ ∈ Submodule.span ℤ R :=
    Submodule.subset_span (by rw [hR]; right; rfl)
  have hdeg_anchor_R : deg i • χmem i₁ ∈ Submodule.span ℤ R :=
    nsmul_mem hanchor_R (deg i)
  have : χmem i = (χmem i - deg i • χmem i₁) + deg i • χmem i₁ := by abel
  rw [this]
  exact Submodule.add_mem _ hdiff_R hdeg_anchor_R

/-- **Supported adjoin-pair generation from anchor generation.**

Assume `ℤ[S₁]` is generated by `ℤ[S₁,A]` together with an anchor `χ₁`.  If the new pair satisfies
the value-at-one relations `χ(1)=aχ₁(1)` and `χ̄(1)=χ(1)`, with `χ₁(1) ≠ 0` and `1 ∉ A`, then the
supported part of `ℤ[S₁ ∪ {χ,χ̄}]` is generated by `ℤ[S₁,A]`, `χ-χ̄`, and `χ-aχ₁`.

This is the structural `hgen` bridge for the §8 X-adjoining step.  The proof first expresses every
generator modulo the anchor, then uses support at `1` to force the anchor coefficient to vanish. -/
theorem zSupportedSpan_adjoinPair_subset_span_of_anchorGeneration
    {S₁ : Set (ClassFunction L ℂ)} {A : Set L}
    {χ chibar chi1 : ClassFunction L ℂ} {a : ℕ}
    (hSgen : Submodule.span ℤ S₁ ≤
      Submodule.span ℤ (zSupportedSpan (L := L) S₁ A ∪ {chi1}))
    (hχ1 : χ (1 : L) = (a : ℂ) * chi1 (1 : L))
    (hbar1 : chibar (1 : L) = χ (1 : L))
    (hchi1_ne : chi1 (1 : L) ≠ 0)
    (h1A : (1 : L) ∉ A) :
    zSupportedSpan (L := L) (S₁ ∪ {χ, chibar}) A ⊆
      Submodule.span ℤ (zSupportedSpan (L := L) S₁ A ∪ {χ - chibar, χ - a • chi1}) := by
  set R : Set (ClassFunction L ℂ) :=
    zSupportedSpan (L := L) S₁ A ∪ {χ - chibar, χ - a • chi1} with hR
  set Rchi1 : Set (ClassFunction L ℂ) := R ∪ {chi1} with hRchi1
  have hbase_mono : Submodule.span ℤ (zSupportedSpan (L := L) S₁ A ∪ {chi1}) ≤
      Submodule.span ℤ Rchi1 := by
    refine Submodule.span_mono ?_
    intro y hy
    rw [hRchi1, hR]
    rcases hy with hy | hy
    · exact Or.inl (Or.inl hy)
    · exact Or.inr hy
  have hgen_big : Submodule.span ℤ (S₁ ∪ {χ, chibar}) ≤ Submodule.span ℤ Rchi1 := by
    refine Submodule.span_le.mpr ?_
    intro y hy
    rcases hy with hyS₁ | hypair
    · exact hbase_mono (hSgen (Submodule.subset_span hyS₁))
    · simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hypair
      have hanchor : chi1 ∈ Submodule.span ℤ Rchi1 :=
        Submodule.subset_span (by rw [hRchi1]; right; rfl)
      have hdiff_ratio : χ - a • chi1 ∈ Submodule.span ℤ Rchi1 :=
        Submodule.subset_span (by rw [hRchi1, hR]; left; right; right; rfl)
      have hdiff_conj : χ - chibar ∈ Submodule.span ℤ Rchi1 :=
        Submodule.subset_span (by rw [hRchi1, hR]; left; right; left; rfl)
      have haχ1 : (a • chi1 : ClassFunction L ℂ) ∈ Submodule.span ℤ Rchi1 :=
        nsmul_mem hanchor a
      have hχ : χ ∈ Submodule.span ℤ Rchi1 := by
        have : χ = (χ - a • chi1) + a • chi1 := by abel
        rw [this]; exact Submodule.add_mem _ hdiff_ratio haχ1
      have hbar : chibar ∈ Submodule.span ℤ Rchi1 := by
        have : chibar = χ - (χ - chibar) := by abel
        rw [this]; exact Submodule.sub_mem _ hχ hdiff_conj
      rcases hypair with rfl | rfl
      · exact hχ
      · exact hbar
  have hR_eval : ∀ y ∈ R, y (1 : L) = 0 := by
    intro y hy
    rw [hR] at hy
    rcases hy with hyS | hydiff
    · by_contra h
      exact h1A (hyS.2 (ClassFunction.mem_support.mpr h))
    · simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hydiff
      rcases hydiff with rfl | rfl
      · rw [ClassFunction.sub_apply, hbar1, sub_self]
      · rw [ClassFunction.sub_apply, ← Nat.cast_smul_eq_nsmul ℂ a chi1,
          ClassFunction.smul_apply, hχ1]
        ring
  intro φ hφ
  have hbig : φ ∈ Submodule.span ℤ Rchi1 := hgen_big hφ.1
  rw [hRchi1, Submodule.span_union, Submodule.mem_sup] at hbig
  obtain ⟨r, hr, c, hc, hrc⟩ := hbig
  obtain ⟨n, hn⟩ := (Submodule.mem_span_singleton.mp hc)
  have hφ1 : φ (1 : L) = 0 := by
    by_contra h
    exact h1A (hφ.2 (ClassFunction.mem_support.mpr h))
  have hspan_eval_zero : ∀ u, u ∈ Submodule.span ℤ R → u (1 : L) = 0 := by
    intro u hu
    induction hu using Submodule.span_induction with
    | mem y hy => exact hR_eval y hy
    | zero => simp
    | add y z _ _ hy hz => rw [ClassFunction.add_apply, hy, hz, add_zero]
    | smul n y _ hy =>
        rw [← Int.cast_smul_eq_zsmul ℂ n y, ClassFunction.smul_apply, hy]
        simp
  have hr1 : r (1 : L) = 0 := hspan_eval_zero r hr
  have hc1 : c (1 : L) = 0 := by
    have h := congrArg (fun ψ : ClassFunction L ℂ => ψ (1 : L)) hrc
    change (r + c) (1 : L) = φ (1 : L) at h
    rw [ClassFunction.add_apply, hr1, hφ1] at h
    simpa using h
  have hn0 : n = 0 := by
    have hn_eval : (n : ℂ) * chi1 (1 : L) = 0 := by
      rw [← hn] at hc1
      rw [← Int.cast_smul_eq_zsmul ℂ n chi1, ClassFunction.smul_apply] at hc1
      simpa [smul_eq_mul] using hc1
    have hnℂ : (n : ℂ) = 0 := (mul_eq_zero.mp hn_eval).resolve_right hchi1_ne
    exact_mod_cast hnℂ
  have hc0 : c = 0 := by rw [← hn, hn0, zero_smul]
  rw [← hrc, hc0, add_zero]
  exact hr

/-- An integral linear map between virtual-character lattices, represented at
the class-function level. -/
abbrev IntegralCharacterMap (L G : Type*) [Group L] [Group G] :=
  ClassFunction L ℂ →ₗ[ℤ] ClassFunction G ℂ

namespace ClassFunction

open OddOrder.RepresentationTheory.ClassFunction

/-- A coefficientwise automorphism sends `ℤ[S]` into the span of the transformed set. -/
theorem mapRingEquiv_mem_zSpan_image (σ : ℂ ≃+* ℂ)
    {S : Set (ClassFunction L ℂ)} {φ : ClassFunction L ℂ}
    (hφ : φ ∈ zSpan (L := L) S) :
    mapRingEquiv σ φ ∈ zSpan (L := L) (mapRingEquiv σ '' S) := by
  induction hφ using Submodule.span_induction with
  | mem x hx =>
      exact Submodule.subset_span ⟨x, hx, rfl⟩
  | zero =>
      rw [mapRingEquiv_zero]
      exact Submodule.zero_mem _
  | add x y _ _ hx hy =>
      rw [mapRingEquiv_add]
      exact Submodule.add_mem _ hx hy
  | smul n x _ hx =>
      rw [mapRingEquiv_zsmul]
      exact Submodule.smul_mem _ n hx

end ClassFunction

namespace IntegralCharacterMap

/-- Transport an integral character map by coefficientwise automorphism on source and target. -/
def galoisTransport (σ : ℂ ≃+* ℂ) (τ : IntegralCharacterMap L G) :
    IntegralCharacterMap L G :=
  (ClassFunction.mapRingEquivLinear (G := G) σ).comp
    (τ.comp (ClassFunction.mapRingEquivLinear (G := L) σ.symm))

@[simp] theorem galoisTransport_apply (σ : ℂ ≃+* ℂ) (τ : IntegralCharacterMap L G)
    (φ : ClassFunction L ℂ) :
    galoisTransport σ τ φ =
      ClassFunction.mapRingEquiv σ (τ (ClassFunction.mapRingEquiv σ.symm φ)) :=
  rfl

end IntegralCharacterMap

/-- The normalized inner-product part of an integral isometry. -/
structure IsIntegralIsometry (τ : IntegralCharacterMap L G)
    [Fintype L] [Fintype G]
    [Invertible (Nat.card L : ℂ)] [Invertible (Nat.card G : ℂ)] : Prop where
  inner_eq :
    ∀ φ ψ : ClassFunction L ℂ,
      ClassFunction.inner (τ φ) (τ ψ) = ClassFunction.inner φ ψ

/-- The Peterfalvi (5.2.d) image data for one character difference.

For `χ ∈ S`, later applications prove that the image of `χ - χ̄` under the
integral isometry is a signed difference of two irreducible characters of `G`.
The hard existence theorem is supplied by
`OddOrder.RepresentationTheory.isometry_difference_pair_structure`; this
structure records the reusable conclusion in the coherence interface. -/
structure CharacterDifferenceImage (τ : IntegralCharacterMap L G)
    (χ : ClassFunction L ℂ) where
  mu : IrreducibleCharacter G
  nu : IrreducibleCharacter G
  distinct : mu ≠ nu
  sign : ℤ
  sign_eq : sign = 1 ∨ sign = -1
  image_eq :
    τ (χ - χ.conj) =
      sign • ((mu : ClassFunction G ℂ) - (nu : ClassFunction G ℂ))

namespace CharacterDifferenceImage

variable {τ : IntegralCharacterMap L G} {χ ψ : ClassFunction L ℂ}

/-- The first irreducible character appearing in the signed image, as a class
function. -/
abbrev muClassFunction (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    ClassFunction G ℂ :=
  hχ.mu

/-- The second irreducible character appearing in the signed image, as a class
function. -/
abbrev nuClassFunction (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    ClassFunction G ℂ :=
  hχ.nu

/-- The unsigned difference `μ - ν` attached to the image of `χ - χ̄`. -/
abbrev difference (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    ClassFunction G ℂ :=
  hχ.muClassFunction - hχ.nuClassFunction

/-- The signed difference `ε • (μ - ν)` attached to the image of `χ - χ̄`. -/
abbrev signedDifference (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    ClassFunction G ℂ :=
  hχ.sign • hχ.difference

@[simp] theorem mu_irreducible
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    IsIrreducibleCharacter hχ.muClassFunction :=
  hχ.mu.isIrreducible

@[simp] theorem nu_irreducible
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    IsIrreducibleCharacter hχ.nuClassFunction :=
  hχ.nu.isIrreducible

/-- The two irreducible characters appearing in the image of `χ - χ̄`.

This is the current two-element form of Peterfalvi's `R(χ)` from (5.2.d). -/
def imageSet (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    Set (ClassFunction G ℂ) :=
  {hχ.muClassFunction, hχ.nuClassFunction}

@[simp] theorem muClassFunction_mem_imageSet
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    hχ.muClassFunction ∈ hχ.imageSet := by
  simp [imageSet]

@[simp] theorem nuClassFunction_mem_imageSet
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    hχ.nuClassFunction ∈ hχ.imageSet := by
  simp [imageSet]

theorem mem_imageSet_iff
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    {φ : ClassFunction G ℂ} :
    φ ∈ hχ.imageSet ↔ φ = hχ.muClassFunction ∨ φ = hχ.nuClassFunction := by
  simp [imageSet]

theorem muClassFunction_ne_nuClassFunction
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    hχ.muClassFunction ≠ hχ.nuClassFunction := by
  intro h
  exact hχ.distinct (IrreducibleCharacter.ext h)

theorem sign_ne_zero
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    hχ.sign ≠ 0 := by
  rcases hχ.sign_eq with hsign | hsign <;> simp [hsign]

theorem sign_mul_self
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    hχ.sign * hχ.sign = 1 := by
  rcases hχ.sign_eq with hsign | hsign <;> simp [hsign]

theorem image_eq_signedDifference
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    τ (χ - χ.conj) = hχ.signedDifference := by
  simpa [signedDifference, difference] using hχ.image_eq

/-- Orthogonality of the two image sets `R(χ)` and `R(ψ)` from Peterfalvi
(5.2.e). -/
def Orthogonal (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    (hψ : CharacterDifferenceImage (L := L) (G := G) τ ψ)
    [Fintype G] [Invertible (Nat.card G : ℂ)] : Prop :=
  ∀ ⦃φ η : ClassFunction G ℂ⦄, φ ∈ hχ.imageSet → η ∈ hψ.imageSet →
    ClassFunction.inner φ η = 0

open scoped Classical in
/-- **Peterfalvi (4.1), cross-domain member form (the `u = v = 1` case).**

The two `CharacterDifferenceImage`s may live over **different domains** `L, L'` (maps `τ, τ'`) but
the
same `G`.  If the signed differences `(χ − χ̄)^τ = ε·(μ − ν)` and `(ψ − ψ̄)^{τ'} = ε'·(μ' − ν')` are
orthogonal in `CF(G)`, then every cross pairing of members vanishes — `μ, ν, μ', ν'` share no
irreducible, so any `a ∈ R(χ)`, `b ∈ R(ψ)` satisfy `(a, b) = 0`.

This is the special `u = v = 1` instance of Peterfalvi (4.1) (mmd 04.6 L5), where the degree /
value-at-`1` hypotheses are not needed: suppose two of `μ, ν, μ', ν'` coincide as irreducibles.
Expanding `0 = (ε(μ−ν), ε'(μ'−ν')) = εε'·((μ,μ') − (μ,ν') − (ν,μ') + (ν,ν'))` against the
orthonormality of `Irr G` (`irreducibleCharacter_inner`) and the within-family distinctness
(`μ ≠ ν`, `μ' ≠ ν'`) collapses the bracket to `±(1 + δ) = 0` with `δ ∈ {0, 1}` a Kronecker delta —
impossible.  So no irreducible is shared, and every cross pairing is `0`.  The proof is
τ-independent; the cross-`L` generality is exactly what Peterfalvi (12.3) needs (`R(χ₁)`, `R(χ₂)`
from non-conjugate maximal subgroups `L₁, L₂`). -/
theorem inner_eq_zero_of_signedDifference_inner_zero_of_mem
    [Fintype G] [Invertible (Nat.card G : ℂ)]
    {L' : Type*} [Group L'] {τ' : IntegralCharacterMap L' G} {ψ' : ClassFunction L' ℂ}
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    (hψ : CharacterDifferenceImage (L := L') (G := G) τ' ψ')
    (hinner : ClassFunction.inner hχ.signedDifference hψ.signedDifference = 0)
    {a b : ClassFunction G ℂ} (ha : a ∈ hχ.imageSet) (hb : b ∈ hψ.imageSet) :
    ClassFunction.inner a b = 0 := by
  classical
  -- Abbreviations for the four irreducible characters of the two families.
  set μ := hχ.mu with hμ
  set ν := hχ.nu with hν
  set μ' := hψ.mu with hμ'
  set ν' := hψ.nu with hν'
  -- The bracket value `b = (μ,μ') − (μ,ν') − (ν,μ') + (ν,ν')` as a Kronecker-delta combination.
  -- Each cross pairing is `δ` by `irreducibleCharacter_inner`.
  have hcross : ∀ a c : IrreducibleCharacter G,
      ClassFunction.inner (a : ClassFunction G ℂ) (c : ClassFunction G ℂ) =
        if a = c then (1 : ℂ) else 0 :=
    fun a c => OddOrder.RepresentationTheory.irreducibleCharacter_inner a c
  -- Sign squares: `εχ·εχ = 1`, `εψ·εψ = 1`.
  have hsχ : (hχ.sign : ℂ) * (hχ.sign : ℂ) = 1 := by
    have := hχ.sign_mul_self; exact_mod_cast congrArg (Int.cast : ℤ → ℂ) this
  have hsψ : (hψ.sign : ℂ) * (hψ.sign : ℂ) = 1 := by
    have := hψ.sign_mul_self; exact_mod_cast congrArg (Int.cast : ℤ → ℂ) this
  -- Expand `0 = (ε(μ−ν), ε'(μ'−ν'))` to the bracket equation `εχ·εψ·(bracket) = 0`.
  have hexpand :
      (hχ.sign : ℂ) * (hψ.sign : ℂ) *
        ((if μ = μ' then (1 : ℂ) else 0) - (if μ = ν' then (1 : ℂ) else 0)
          - (if ν = μ' then (1 : ℂ) else 0) + (if ν = ν' then (1 : ℂ) else 0)) = 0 := by
    have h := hinner
    -- Unfold the abbreviations and convert the `ℤ`-smul signs to `ℂ`-smul.
    simp only [signedDifference, difference, muClassFunction, nuClassFunction] at h
    rw [← Int.cast_smul_eq_zsmul ℂ hχ.sign, ← Int.cast_smul_eq_zsmul ℂ hψ.sign,
      ClassFunction.inner_smul_left, OddOrder.RepresentationTheory.inner_smul_right,
      ClassFunction.inner_sub_left, ClassFunction.inner_sub_right,
      ClassFunction.inner_sub_right, star_intCast,
      hcross μ μ', hcross μ ν', hcross ν μ', hcross ν ν'] at h
    -- `h : εχ · (εψ · (bracket)) = 0`; reassociate to the bracket form.
    linear_combination h
  -- The product of nonzero signs is nonzero, so the bracket itself is `0`.
  have hsignprod : (hχ.sign : ℂ) * (hψ.sign : ℂ) ≠ 0 := by
    have h1 : (hχ.sign : ℂ) ≠ 0 := by
      rcases hχ.sign_eq with h | h <;> simp [h]
    have h2 : (hψ.sign : ℂ) ≠ 0 := by
      rcases hψ.sign_eq with h | h <;> simp [h]
    exact mul_ne_zero h1 h2
  have hbracket :
      (if μ = μ' then (1 : ℂ) else 0) - (if μ = ν' then (1 : ℂ) else 0)
        - (if ν = μ' then (1 : ℂ) else 0) + (if ν = ν' then (1 : ℂ) else 0) = 0 :=
    (mul_eq_zero.mp hexpand).resolve_left hsignprod
  -- Within-family distinctness.
  have hμν : μ ≠ ν := hχ.distinct
  have hμ'ν' : μ' ≠ ν' := hψ.distinct
  -- No irreducible is shared across the two families: each cross-equality contradicts `hbracket`.
  -- We show all four `if` conditions are false.  In each case the other three deltas are forced,
  -- collapsing the bracket to `1 + (0 or 1) ≥ 1 ≠ 0`.
  have key : μ ≠ μ' ∧ μ ≠ ν' ∧ ν ≠ μ' ∧ ν ≠ ν' := by
    refine ⟨?_, ?_, ?_, ?_⟩
    · -- `μ = μ'`: then `μ ≠ ν'` (else `μ' = ν'`), `ν ≠ μ'` (else `ν = μ`); bracket `= 1 + [ν=ν']`.
      intro h
      have hμν' : μ ≠ ν' := fun he => hμ'ν' (h ▸ he)
      have hνμ' : ν ≠ μ' := fun he => hμν (he.trans h.symm).symm
      rw [if_pos h, if_neg hμν', if_neg hνμ'] at hbracket
      revert hbracket; split_ifs <;> intro hb <;> norm_num at hb
    · -- `μ = ν'`: then `μ ≠ μ'` (else `μ' = ν'`), `ν ≠ ν'` (else `ν = μ`); bracket `= −1 − [ν=μ']`.
      intro h
      have hμμ' : μ ≠ μ' := fun he => hμ'ν' (he.symm.trans h)
      have hνν' : ν ≠ ν' := fun he => hμν (he.trans h.symm).symm
      rw [if_pos h, if_neg hμμ', if_neg hνν'] at hbracket
      revert hbracket; split_ifs <;> intro hb <;> norm_num at hb
    · -- `ν = μ'`: then `ν ≠ ν'` (else `μ' = ν'`), `μ ≠ μ'` (else `μ = ν`); bracket `= −1 − [μ=ν']`.
      intro h
      have hνν' : ν ≠ ν' := fun he => hμ'ν' (h ▸ he)
      have hμμ' : μ ≠ μ' := fun he => hμν (he.trans h.symm)
      rw [if_pos h, if_neg hνν', if_neg hμμ'] at hbracket
      revert hbracket; split_ifs <;> intro hb <;> norm_num at hb
    · -- `ν = ν'`: then `ν ≠ μ'` (else `μ' = ν'`), `μ ≠ ν'` (else `μ = ν`); bracket `= 1 + [μ=μ']`.
      intro h
      have hνμ' : ν ≠ μ' := fun he => hμ'ν' (he.symm.trans h)
      have hμν' : μ ≠ ν' := fun he => hμν (he.trans h.symm)
      rw [if_pos h, if_neg hνμ', if_neg hμν'] at hbracket
      revert hbracket; split_ifs <;> intro hb <;> norm_num at hb
  -- Conclude: the chosen members `a ∈ R(χ)`, `b ∈ R(ψ)` are orthogonal.
  rw [hχ.mem_imageSet_iff] at ha
  rw [hψ.mem_imageSet_iff] at hb
  obtain ⟨h1, h2, h3, h4⟩ := key
  rcases ha with rfl | rfl <;> rcases hb with rfl | rfl <;>
    simp only [muClassFunction, nuClassFunction]
  · rw [hcross μ μ', if_neg h1]
  · rw [hcross μ ν', if_neg h2]
  · rw [hcross ν μ', if_neg h3]
  · rw [hcross ν ν', if_neg h4]

/-- **Peterfalvi (5.2.e)/(4.1) same-domain form** (`R(χ).Orthogonal R(ψ)` for `χ, ψ` over the same
`L`): the `CharacterDifferenceImage.Orthogonal`-facing wrapper of the cross-domain member lemma
`inner_eq_zero_of_signedDifference_inner_zero_of_mem`. -/
theorem orthogonal_of_signedDifference_inner_eq_zero
    [Fintype G] [Invertible (Nat.card G : ℂ)]
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    (hψ : CharacterDifferenceImage (L := L) (G := G) τ ψ)
    (hinner : ClassFunction.inner hχ.signedDifference hψ.signedDifference = 0) :
    hχ.Orthogonal hψ :=
  fun _a _b ha hb => inner_eq_zero_of_signedDifference_inner_zero_of_mem hχ hψ hinner ha hb

/-- Restatement using the named §3/§7 helper for the expression `χ - χ̄`. -/
theorem image_conjugateDifference (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    τ (OddOrder.Peterfalvi.S03.conjugateDifference χ) =
      hχ.signedDifference := by
  simpa [OddOrder.Peterfalvi.S03.conjugateDifference] using hχ.image_eq_signedDifference

end CharacterDifferenceImage

open scoped Classical in
open OddOrder.RepresentationTheory in
/-- **Peterfalvi (5.2.d): orthonormal character-difference image.**

For `χ ∈ S`, the image of `χ - χ̄` under the integral isometry `τ` is a sum
`(χ - χ̄)^τ = ∑_{α ∈ R(χ)} α` over a finite **orthonormal** family `R(χ) = imageSet`
of virtual characters (each `α ∈ ℤ[Irr G]`, `‖α‖² = 1`, mutually orthogonal).  This is
the general form of `CharacterDifferenceImage`, which is recovered as the two-element case
via `CharacterDifferenceImage.toOrthonormalImage`. -/
structure OrthonormalCharacterImageFamily (τ : IntegralCharacterMap L G)
    (χ : ClassFunction L ℂ)
    [Fintype G] [Invertible (Nat.card G : ℂ)] where
  /-- The orthonormal subset `R(χ)` of `ℤ[Irr G]`. -/
  imageSet : Finset (ClassFunction G ℂ)
  /-- Every member of `R(χ)` is a virtual character of `G`. -/
  mem_ZIrr : ∀ α ∈ imageSet, α ∈ ZIrr G
  /-- `R(χ)` is orthonormal: `⟨α, β⟩ = δ_{α,β}` for `α, β ∈ R(χ)`. -/
  orthonormal :
    ∀ α ∈ imageSet, ∀ β ∈ imageSet,
      ClassFunction.inner α β = if α = β then (1 : ℂ) else 0
  /-- The image equation `(χ - χ̄)^τ = ∑_{α ∈ R(χ)} α`. -/
  image_eq : τ (χ - χ.conj) = ∑ α ∈ imageSet, α

namespace OrthonormalCharacterImageFamily

open OddOrder.RepresentationTheory

variable {τ : IntegralCharacterMap L G} {χ ψ : ClassFunction L ℂ}

variable [Fintype G] [Invertible (Nat.card G : ℂ)]

/-- **Transport an image family along an equality of integral character maps.**

Only `image_eq` mentions `τ`, so `imageSet`/`mem_ZIrr`/`orthonormal` carry over verbatim and
`(R.congrTau h).imageSet` is *definitionally* `R.imageSet`.  That matters because `Orthogonal` is
stated purely in terms of `imageSet`, so orthogonality proved for the source family applies to the
transported one without further work.

The use is the (5.6)/(6.2) plumbing: the certain-type `R`-families are produced for a Hypothesis
(4.6)'s stored isometry `h.tau`, while the norm-weighted engines hardcode
`hyp.fullDadeIsometryData hconj`.  Those are equal but not syntactically so, and rewriting the
*hypotheses* instead breaks the dependent occurrences (`IsCoherent.extension` in the per-member
clauses); transporting the family is the seam that stays local. -/
def congrTau {τ₁ τ₂ : IntegralCharacterMap L G} (h : τ₁ = τ₂)
    (R : OrthonormalCharacterImageFamily (L := L) (G := G) τ₁ χ) :
    OrthonormalCharacterImageFamily (L := L) (G := G) τ₂ χ where
  imageSet := R.imageSet
  mem_ZIrr := R.mem_ZIrr
  orthonormal := R.orthonormal
  image_eq := by rw [← h]; exact R.image_eq

@[simp] theorem congrTau_imageSet {τ₁ τ₂ : IntegralCharacterMap L G} (h : τ₁ = τ₂)
    (R : OrthonormalCharacterImageFamily (L := L) (G := G) τ₁ χ) :
    (R.congrTau h).imageSet = R.imageSet := rfl

/-- The squared norm of an element of `R(χ)` is `1`. -/
theorem inner_self_of_mem (R : OrthonormalCharacterImageFamily (L := L) (G := G) τ χ)
    {α : ClassFunction G ℂ} (hα : α ∈ R.imageSet) :
    ClassFunction.inner α α = 1 := by
  rw [R.orthonormal α hα α hα, if_pos rfl]

/-- **Peterfalvi (5.2.e): disjoint-pair orthogonality.**  Two image families `R(χ)`,
`R(ψ)` are orthogonal if every `α ∈ R(χ)` is orthogonal to every `β ∈ R(ψ)`. -/
def Orthogonal (R : OrthonormalCharacterImageFamily (L := L) (G := G) τ χ)
    (R' : OrthonormalCharacterImageFamily (L := L) (G := G) τ ψ) : Prop :=
  ∀ α ∈ R.imageSet, ∀ β ∈ R'.imageSet, ClassFunction.inner α β = 0

theorem Orthogonal.inner_eq_zero
    {R : OrthonormalCharacterImageFamily (L := L) (G := G) τ χ}
    {R' : OrthonormalCharacterImageFamily (L := L) (G := G) τ ψ}
    (h : R.Orthogonal R') {α β : ClassFunction G ℂ}
    (hα : α ∈ R.imageSet) (hβ : β ∈ R'.imageSet) :
    ClassFunction.inner α β = 0 :=
  h α hα β hβ

end OrthonormalCharacterImageFamily

namespace CharacterDifferenceImage

open OddOrder.RepresentationTheory

variable {τ : IntegralCharacterMap L G} {χ : ClassFunction L ℂ}

variable [Fintype G] [Invertible (Nat.card G : ℂ)]

open scoped Classical in
/-- `⟨ε·μ, ε·μ⟩ = 1`, `⟨-ε·ν, -ε·ν⟩ = 1`, `⟨ε·μ, -ε·ν⟩ = 0`: the orthonormality
of the two-element family `{ε·μ, -ε·ν}` underlying the two-element case.

Stated as the `δ_{·,·}` identity for the (ℤ-scaled) pair, by reducing the
`ℤ`-scalar `ε` to the `ℂ`-scalar `(ε : ℂ)` and using row orthogonality with
`ε² = 1`.  (The sign hypotheses `hs`/`ht` are unused in the proof but pin down
which scaled pair is meant.) -/
theorem inner_signSmul_pair_eq_ite
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) {s t : ℤ}
    {a b : ClassFunction G ℂ}
    (ha : a = hχ.muClassFunction ∨ a = hχ.nuClassFunction)
    (hb : b = hχ.muClassFunction ∨ b = hχ.nuClassFunction) :
    ClassFunction.inner (s • a) (t • b) =
      (s : ℂ) * (t : ℂ) * (if a = b then (1 : ℂ) else 0) := by
  classical
  have hpair : ClassFunction.inner a b = if a = b then (1 : ℂ) else 0 := by
    have hμμ : ClassFunction.inner hχ.muClassFunction hχ.muClassFunction = 1 := by
      simpa [muClassFunction, OddOrder.RepresentationTheory.characterTableRowPairing] using
        OddOrder.RepresentationTheory.CharacterTableRowOrthogonality.diagonal
          (G := G) OddOrder.RepresentationTheory.characterTableRowOrthogonality hχ.mu
    have hνν : ClassFunction.inner hχ.nuClassFunction hχ.nuClassFunction = 1 := by
      simpa [nuClassFunction, OddOrder.RepresentationTheory.characterTableRowPairing] using
        OddOrder.RepresentationTheory.CharacterTableRowOrthogonality.diagonal
          (G := G) OddOrder.RepresentationTheory.characterTableRowOrthogonality hχ.nu
    have hμν : ClassFunction.inner hχ.muClassFunction hχ.nuClassFunction = 0 := by
      simpa [muClassFunction, nuClassFunction,
        OddOrder.RepresentationTheory.characterTableRowPairing] using
        OddOrder.RepresentationTheory.CharacterTableRowOrthogonality.offDiagonal
          (G := G) OddOrder.RepresentationTheory.characterTableRowOrthogonality hχ.distinct
    have hνμ : ClassFunction.inner hχ.nuClassFunction hχ.muClassFunction = 0 := by
      simpa [muClassFunction, nuClassFunction,
        OddOrder.RepresentationTheory.characterTableRowPairing] using
        OddOrder.RepresentationTheory.CharacterTableRowOrthogonality.offDiagonal
          (G := G) OddOrder.RepresentationTheory.characterTableRowOrthogonality
          (Ne.symm hχ.distinct)
    have hμν_ne : hχ.muClassFunction ≠ hχ.nuClassFunction :=
      hχ.muClassFunction_ne_nuClassFunction
    rcases ha with rfl | rfl <;> rcases hb with rfl | rfl
    · rw [hμμ, if_pos rfl]
    · rw [hμν, if_neg hμν_ne]
    · rw [hνμ, if_neg (Ne.symm hμν_ne)]
    · rw [hνν, if_pos rfl]
  rw [← Int.cast_smul_eq_zsmul ℂ s a, ← Int.cast_smul_eq_zsmul ℂ t b,
    ClassFunction.inner_smul_left, OddOrder.RepresentationTheory.inner_smul_right,
    hpair, star_intCast]
  ring

omit [Fintype G] in
/-- The two members `ε·μ` and `-ε·ν` of the two-element family are distinct. -/
theorem signMu_ne_negSignNu [Finite G] (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    hχ.sign • (hχ.muClassFunction) ≠ (-hχ.sign) • (hχ.nuClassFunction) := by
  have : Fintype G := Fintype.ofFinite G
  intro h
  -- `⟨ε·μ, ε·μ⟩ = ε² = 1`, but if `ε·μ = -ε·ν` it equals `⟨ε·μ, -ε·ν⟩ = -ε²⟨μ,ν⟩ = 0`.
  have hself := hχ.inner_signSmul_pair_eq_ite (s := hχ.sign) (t := hχ.sign)
    (a := hχ.muClassFunction) (b := hχ.muClassFunction) (Or.inl rfl) (Or.inl rfl)
  have hcross := hχ.inner_signSmul_pair_eq_ite (s := hχ.sign) (t := -hχ.sign)
    (a := hχ.muClassFunction) (b := hχ.nuClassFunction) (Or.inl rfl) (Or.inr rfl)
  rw [if_pos rfl, mul_one] at hself
  rw [if_neg hχ.muClassFunction_ne_nuClassFunction, mul_zero] at hcross
  have hsign : (hχ.sign : ℂ) * (hχ.sign : ℂ) = 1 := by
    have := hχ.sign_mul_self; exact_mod_cast congrArg (Int.cast : ℤ → ℂ) this
  rw [hsign] at hself
  -- `⟨ε·μ, ε·μ⟩ = 1`; replace the *second* `ε·μ` by `-ε·ν` via `h`, then `hcross` gives `1 = 0`.
  nth_rewrite 2 [h] at hself
  rw [hcross] at hself
  exact one_ne_zero hself.symm

open scoped Classical in
/-- **Two-element case of (5.2.d).**  The special two-element `CharacterDifferenceImage`
data yields a genuine `OrthonormalCharacterImageFamily` with `R(χ) = {ε·μ, -ε·ν}`.  This
shows the general gateway subsumes the existing two-element interface. -/
noncomputable def toOrthonormalImage
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ) :
    OrthonormalCharacterImageFamily (L := L) (G := G) τ χ where
  imageSet := {hχ.sign • hχ.muClassFunction, (-hχ.sign) • hχ.nuClassFunction}
  mem_ZIrr := by
    intro α hα
    simp only [Finset.mem_insert, Finset.mem_singleton] at hα
    rcases hα with rfl | rfl
    · exact Submodule.smul_mem _ _ hχ.mu.mem_ZIrr
    · exact Submodule.smul_mem _ _ hχ.nu.mem_ZIrr
  orthonormal := by
    classical
    have hsign : (hχ.sign : ℂ) * (hχ.sign : ℂ) = 1 := by
      have := hχ.sign_mul_self; exact_mod_cast congrArg (Int.cast : ℤ → ℂ) this
    have hne := hχ.signMu_ne_negSignNu
    intro α hα β hβ
    simp only [Finset.mem_insert, Finset.mem_singleton] at hα hβ
    rcases hα with rfl | rfl <;> rcases hβ with rfl | rfl
    · rw [if_pos rfl, hχ.inner_signSmul_pair_eq_ite (Or.inl rfl) (Or.inl rfl),
        if_pos rfl, mul_one, hsign]
    · rw [if_neg hne, hχ.inner_signSmul_pair_eq_ite (Or.inl rfl) (Or.inr rfl),
        if_neg hχ.muClassFunction_ne_nuClassFunction, mul_zero]
    · rw [if_neg (Ne.symm hne), hχ.inner_signSmul_pair_eq_ite (Or.inr rfl) (Or.inl rfl),
        if_neg (Ne.symm hχ.muClassFunction_ne_nuClassFunction), mul_zero]
    · rw [if_pos rfl, hχ.inner_signSmul_pair_eq_ite (Or.inr rfl) (Or.inr rfl),
        if_pos rfl, mul_one]
      push_cast
      rw [neg_mul_neg, hsign]
  image_eq := by
    rw [hχ.image_eq, Finset.sum_pair hχ.signMu_ne_negSignNu, neg_smul, ← sub_eq_add_neg,
      ← smul_sub]

open scoped Classical in
/-- **The two-element-family orthogonality transports through `toOrthonormalImage`.**

If the unsigned families `R(χ) = {μ, ν}` and `R(ψ) = {μ', ν'}` of two `CharacterDifferenceImage`s
are cross-orthogonal (`hχ.Orthogonal hψ`, the (5.2.e) conclusion), then the orthonormal families
`{ε·μ, −ε·ν}` and `{ε'·μ', −ε'·ν'}` produced by `toOrthonormalImage` are orthogonal as
`OrthonormalCharacterImageFamily`s: scaling by the `±1` signs preserves the vanishing cross
pairings `⟨a, b⟩ = 0` (`a ∈ {μ, ν}`, `b ∈ {μ', ν'}`) since `⟨s • a, t • b⟩ = s̄·t·⟨a, b⟩`. -/
theorem toOrthonormalImage_orthogonal
    {ψ : ClassFunction L ℂ}
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    (hψ : CharacterDifferenceImage (L := L) (G := G) τ ψ)
    (h : hχ.Orthogonal hψ) :
    hχ.toOrthonormalImage.Orthogonal hψ.toOrthonormalImage := by
  classical
  intro α hα β hβ
  -- Unfold the two scaled-pair image sets.
  simp only [toOrthonormalImage, Finset.mem_insert, Finset.mem_singleton] at hα hβ
  -- Each cross pairing `⟨s • a, t • b⟩ = s̄ · t · ⟨a, b⟩` with `⟨a, b⟩ = 0` from `h`.  Convert the
  -- `ℤ`-smul signs to `ℂ`-smul so `inner_smul_left`/`inner_smul_right` apply.
  rcases hα with rfl | rfl <;> rcases hβ with rfl | rfl <;>
    rw [← Int.cast_smul_eq_zsmul ℂ, ← Int.cast_smul_eq_zsmul ℂ,
      ClassFunction.inner_smul_left, OddOrder.RepresentationTheory.inner_smul_right]
  · rw [h hχ.muClassFunction_mem_imageSet hψ.muClassFunction_mem_imageSet, mul_zero, mul_zero]
  · rw [h hχ.muClassFunction_mem_imageSet hψ.nuClassFunction_mem_imageSet, mul_zero, mul_zero]
  · rw [h hχ.nuClassFunction_mem_imageSet hψ.muClassFunction_mem_imageSet, mul_zero, mul_zero]
  · rw [h hχ.nuClassFunction_mem_imageSet hψ.nuClassFunction_mem_imageSet, mul_zero, mul_zero]

open scoped Classical in
/-- **Cross-domain member orthogonality through `toOrthonormalImage`.**  The orthonormal families
`{ε·μ, −ε·ν}` and `{ε'·μ', −ε'·ν'}` produced by `toOrthonormalImage` from two
`CharacterDifferenceImage`s over *possibly different* domains `L, L'` (maps `τ, τ'`, same `G`) have
all member cross pairings `0`, given only that the signed differences are orthogonal
(`⟨(χ−χ̄)^τ, (ψ−ψ̄)^{τ'}⟩ = 0`).  Sign-scales the cross-domain (4.1) member lemma
`inner_eq_zero_of_signedDifference_inner_zero_of_mem` (`⟨s•a, t•b⟩ = s̄·t·⟨a,b⟩`).  This is the form
Peterfalvi (12.3) consumes (`R(χ₁) ⊥ R(χ₂)` for non-conjugate maximal subgroups `L₁, L₂`). -/
theorem toOrthonormalImage_inner_eq_zero_across
    {L' : Type*} [Group L'] {τ' : IntegralCharacterMap L' G} {ψ' : ClassFunction L' ℂ}
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    (hψ : CharacterDifferenceImage (L := L') (G := G) τ' ψ')
    (hinner : ClassFunction.inner hχ.signedDifference hψ.signedDifference = 0)
    {a b : ClassFunction G ℂ}
    (ha : a ∈ hχ.toOrthonormalImage.imageSet) (hb : b ∈ hψ.toOrthonormalImage.imageSet) :
    ClassFunction.inner a b = 0 := by
  simp only [toOrthonormalImage, Finset.mem_insert, Finset.mem_singleton] at ha hb
  rcases ha with rfl | rfl <;> rcases hb with rfl | rfl <;>
    rw [← Int.cast_smul_eq_zsmul ℂ, ← Int.cast_smul_eq_zsmul ℂ,
      ClassFunction.inner_smul_left, OddOrder.RepresentationTheory.inner_smul_right]
  · rw [inner_eq_zero_of_signedDifference_inner_zero_of_mem hχ hψ hinner
      hχ.muClassFunction_mem_imageSet hψ.muClassFunction_mem_imageSet, mul_zero, mul_zero]
  · rw [inner_eq_zero_of_signedDifference_inner_zero_of_mem hχ hψ hinner
      hχ.muClassFunction_mem_imageSet hψ.nuClassFunction_mem_imageSet, mul_zero, mul_zero]
  · rw [inner_eq_zero_of_signedDifference_inner_zero_of_mem hχ hψ hinner
      hχ.nuClassFunction_mem_imageSet hψ.muClassFunction_mem_imageSet, mul_zero, mul_zero]
  · rw [inner_eq_zero_of_signedDifference_inner_zero_of_mem hχ hψ hinner
      hχ.nuClassFunction_mem_imageSet hψ.nuClassFunction_mem_imageSet, mul_zero, mul_zero]

end CharacterDifferenceImage

section DifferenceImageProducer

open OddOrder.RepresentationTheory

variable [Finite L]

/-- The conjugate irreducible character `χ̄` of `χ`, packaged as an `IrreducibleCharacter`. -/
noncomputable abbrev conjIrreducibleCharacter (χ : IrreducibleCharacter L) :
    IrreducibleCharacter L :=
  ⟨(χ : ClassFunction L ℂ).conj, χ.isIrreducible.conj⟩

@[simp] theorem coe_conjIrreducibleCharacter (χ : IrreducibleCharacter L) :
    (conjIrreducibleCharacter (L := L) χ : ClassFunction L ℂ) = (χ : ClassFunction L ℂ).conj :=
  rfl

/-- The two-element family `{χ, χ̄}` used as the (1.4) keystone input for the difference image. -/
noncomputable abbrev conjPairFamily (χ : IrreducibleCharacter L) :
    Fin 2 → IrreducibleCharacter L :=
  ![χ, conjIrreducibleCharacter (L := L) χ]

/-- The conjugate of an irreducible character fixes the value at `1` (the degree is a natural
number, hence real).  Used to discharge the equal-degree hypothesis of (1.4) for `{χ, χ̄}`. -/
theorem irreducibleCharacter_conj_apply_one
    (χ : IrreducibleCharacter L) :
    ((χ : ClassFunction L ℂ).conj : L → ℂ) 1 = ((χ : ClassFunction L ℂ) : L → ℂ) 1 := by
  obtain ⟨n, _, hn, _⟩ := χ.isIrreducible.exists_natDegree_charValue_one_dvd_card
  rw [ClassFunction.conj_apply, show ((χ : ClassFunction L ℂ) : L → ℂ) 1 = (χ : ClassFunction L ℂ) 1
      from rfl, hn, star_natCast]

variable [Fintype L] [Fintype G] [Invertible (Nat.card L : ℂ)] [Invertible (Nat.card G : ℂ)]

/-- **Peterfalvi (5.2.d), the existence of the difference image.**

Given an integral isometry `τ`, an irreducible character `χ` of `L` that is **not real**
(so `χ ≠ χ̄`), and the three (1.4) hypotheses on the two-element family `{χ, χ̄}` — the images of
`χ - χ̄` are virtual characters of `G`, vanish at `1`, and the inner product is preserved — the
image of `χ - χ̄` under `τ` is a signed difference `ε•(μ - ν)` of two distinct irreducible
characters of `G`.  This **constructs** the `CharacterDifferenceImage τ χ` record (the §7 `R(χ)`
gateway), reading `μ, ν, ε` off the `SignedIrreducibleDifferenceFamily` delivered by the §3
keystone `isometry_difference_pair_structure`.

Indexing: the family is `χ ↦ ![χ, χ̄]`, so `χ̄ - χ` is index `1`; the keystone gives
`τ(χ̄ - χ) = ε•(μ₁ - μ₀)`, whence `τ(χ - χ̄) = ε•(μ₀ - μ₁)`, recorded with `μ := μ₀`, `ν := μ₁`. -/
noncomputable def characterDifferenceImageOfIsometry
    (τ : IntegralCharacterMap L G) (χ : IrreducibleCharacter L)
    (hreal : ¬ ClassFunction.IsReal (χ : ClassFunction L ℂ))
    (hvirtual : IsometryDifferenceImagesAreVirtual (G := G) (H := L) τ (conjPairFamily (L := L) χ))
    (hzero : IsometryDifferenceImagesVanishAtOne (G := G) (H := L) τ (conjPairFamily (L := L) χ))
    (hisom : ∀ i j,
        ClassFunction.inner
            (isometryDifferenceImage τ (conjPairFamily (L := L) χ) i)
            (isometryDifferenceImage τ (conjPairFamily (L := L) χ) j) =
          ClassFunction.inner
            (irreducibleCharacterDifference (conjPairFamily (L := L) χ) i)
            (irreducibleCharacterDifference (conjPairFamily (L := L) χ) j)) :
    CharacterDifferenceImage (L := L) (G := G) τ (χ : ClassFunction L ℂ) := by
  classical
  set fam : Fin 2 → IrreducibleCharacter L := conjPairFamily (L := L) χ with hfam
  have hfam0 : (fam 0 : ClassFunction L ℂ) = (χ : ClassFunction L ℂ) := by
    simp [hfam, conjPairFamily]
  have hfam1 : (fam 1 : ClassFunction L ℂ) = (χ : ClassFunction L ℂ).conj := by
    simp [hfam, conjPairFamily]
  -- The two family members are distinct: `χ ≠ χ̄` because `χ` is not real.
  have hne_coe : (fam 0 : ClassFunction L ℂ) ≠ (fam 1 : ClassFunction L ℂ) := by
    rw [hfam0, hfam1]
    intro h
    exact hreal h.symm
  have hinj : Function.Injective fam := by
    have : fam 0 ≠ fam 1 := fun h => hne_coe (congrArg IrreducibleCharacter.toClassFunction h)
    intro i j hij
    fin_cases i <;> fin_cases j <;> first
      | rfl
      | (exact absurd hij this)
      | (exact absurd hij.symm this)
  -- Equal degree: `χ̄(1) = χ(1)` since the degree is a natural number.
  have hdeg : ∀ i, ((fam i : ClassFunction L ℂ) : L → ℂ) 1 =
      ((fam 0 : ClassFunction L ℂ) : L → ℂ) 1 := by
    refine Fin.forall_fin_two.mpr ⟨rfl, ?_⟩
    rw [hfam1, hfam0]
    exact irreducibleCharacter_conj_apply_one χ
  -- Apply the §3 keystone to the family `{χ, χ̄}`.  The existence is `Prop`-valued, so we extract
  -- the `SignedIrreducibleDifferenceFamily` constructively via `Exists.choose` (this `def` is
  -- `noncomputable`).
  set data := (isometry_difference_pair_structure (le_refl 2) fam hinj hdeg τ hvirtual hzero
    hisom).choose with hdata_def
  have hdata := (isometry_difference_pair_structure (le_refl 2) fam hinj hdeg τ hvirtual hzero
    hisom).choose_spec
  -- `μ := data.mu 0`, `ν := data.mu 1`, `ε := data.sign`.
  have hone : (1 : Fin 2) ≠ 0 := by decide
  have hmu_ne : data.mu 0 ≠ data.mu 1 := fun h => hone (data.injective h.symm)
  refine
    { mu := data.mu 0
      nu := data.mu 1
      distinct := hmu_ne
      sign := data.sign
      sign_eq := data.sign_eq
      image_eq := ?_ }
  -- `τ(χ - χ̄) = -τ(χ̄ - χ) = -ε•(μ₁ - μ₀) = ε•(μ₀ - μ₁)`.
  -- `χ̄ - χ` is `irreducibleCharacterDifference fam 1`; its image is `data.signedDifference 1`.
  have h1 := hdata 1
  rw [isometryDifferenceImage, irreducibleCharacterDifference, hfam0, hfam1,
    SignedIrreducibleDifferenceFamily.signedDifference,
    SignedIrreducibleDifferenceFamily.difference,
    SignedIrreducibleDifferenceFamily.classFunction,
    SignedIrreducibleDifferenceFamily.classFunction] at h1
  -- From `τ(χ̄ - χ) = ε•(μ₁ - μ₀)` conclude `τ(χ - χ̄) = ε•(μ₀ - μ₁)`.
  -- `τ(χ - χ̄) = τ(-(χ̄ - χ)) = -τ(χ̄ - χ) = -(ε•(μ₁ - μ₀)) = ε•(μ₀ - μ₁)`.
  have hlhs : (χ : ClassFunction L ℂ) - (χ : ClassFunction L ℂ).conj =
      -((χ : ClassFunction L ℂ).conj - (χ : ClassFunction L ℂ)) := by
    rw [neg_sub]
  rw [hlhs, map_neg, h1, ← smul_neg, neg_sub]

omit [Finite L] [Fintype L] [Fintype G] [Invertible (Nat.card L : ℂ)] in
/-- **Peterfalvi (5.9.b), the conjugate pairing of the difference image**: when `τ` commutes
with complex conjugation on the difference `χ − χ̄` (e.g. the Dade base map on a supported
difference, via `dadeIntegralCharacterMap_mapRingEquiv_comm`), the two irreducibles of the
image `(χ − χ̄)^τ = ε·(μ − ν)` are conjugate: `ν = μ̄`, so `(χ − χ̄)^τ = ε·(μ − μ̄)`.

Conjugating the image equation gives `ε·(μ̄ − ν̄) = ((χ−χ̄)^τ)‾ = (χ̄−χ)^τ = ε·(ν − μ)`;
cancelling `ε` and pairing with `μ` against the orthonormality of `Irr G` forces `ν̄ = μ`.
This is the step of the (12.3) bar-trick that writes `(φ−φ̄)^τ = α − ᾱ`. -/
theorem CharacterDifferenceImage.nu_eq_mu_conj
    {τ : IntegralCharacterMap L G} {χ : ClassFunction L ℂ} [Finite G]
    (hχ : CharacterDifferenceImage (L := L) (G := G) τ χ)
    (hcomm : τ ((χ - χ.conj).conj) = (τ (χ - χ.conj)).conj) :
    hχ.nuClassFunction = hχ.muClassFunction.conj := by
  have : Fintype G := Fintype.ofFinite G
  classical
  -- Conjugating the image: `((χ−χ̄)^τ)‾ = (χ̄−χ)^τ = −(χ−χ̄)^τ`.
  have hneg : (τ (χ - χ.conj)).conj = -(τ (χ - χ.conj)) := by
    calc (τ (χ - χ.conj)).conj
        = τ ((χ - χ.conj).conj) := hcomm.symm
      _ = τ (-(χ - χ.conj)) := by
          rw [ClassFunction.conj_sub, ClassFunction.conj_conj, neg_sub]
      _ = -(τ (χ - χ.conj)) := map_neg τ _
  -- Substitute `(χ−χ̄)^τ = ε·(μ − ν)` and push the conjugation through the `ℤ`-scalar.
  rw [hχ.image_eq] at hneg
  rw [← Int.cast_smul_eq_zsmul ℂ] at hneg
  have hconj_smul : (((hχ.sign : ℂ)) •
        ((hχ.mu : ClassFunction G ℂ) - (hχ.nu : ClassFunction G ℂ))).conj
      = (hχ.sign : ℂ) •
        ((hχ.mu : ClassFunction G ℂ).conj - (hχ.nu : ClassFunction G ℂ).conj) := by
    ext g
    simp only [ClassFunction.conj_apply, ClassFunction.smul_apply, ClassFunction.sub_apply,
      star_mul', star_sub, star_intCast]
  rw [hconj_smul, ← smul_neg, neg_sub] at hneg
  -- Cancel the nonzero sign: `μ̄ − ν̄ = ν − μ`.
  have hsign_ne : ((hχ.sign : ℂ)) ≠ 0 := Int.cast_ne_zero.mpr hχ.sign_ne_zero
  have hkey : (hχ.mu : ClassFunction G ℂ).conj - (hχ.nu : ClassFunction G ℂ).conj
      = (hχ.nu : ClassFunction G ℂ) - (hχ.mu : ClassFunction G ℂ) :=
    smul_right_injective (ClassFunction G ℂ) hsign_ne hneg
  -- Pair with `μ` against the orthonormality of `Irr G`.
  have hcross : ∀ a c : IrreducibleCharacter G,
      ClassFunction.inner (a : ClassFunction G ℂ) (c : ClassFunction G ℂ) =
        if a = c then (1 : ℂ) else 0 :=
    fun a c => OddOrder.RepresentationTheory.irreducibleCharacter_inner a c
  have hinner := congrArg
    (fun f => ClassFunction.inner f (hχ.mu : ClassFunction G ℂ)) hkey
  simp only [ClassFunction.inner_sub_left] at hinner
  rw [show (hχ.mu : ClassFunction G ℂ).conj
        = (conjIrreducibleCharacter (L := G) hχ.mu : ClassFunction G ℂ) from rfl,
    show (hχ.nu : ClassFunction G ℂ).conj
        = (conjIrreducibleCharacter (L := G) hχ.nu : ClassFunction G ℂ) from rfl,
    hcross, hcross, hcross, hcross] at hinner
  by_cases hcase : conjIrreducibleCharacter (L := G) hχ.nu = hχ.mu
  · -- `ν̄ = μ`, hence `ν = μ̄`.
    have hcoe : (hχ.nu : ClassFunction G ℂ).conj = (hχ.mu : ClassFunction G ℂ) :=
      congrArg (fun c : IrreducibleCharacter G => (c : ClassFunction G ℂ)) hcase
    change (hχ.nu : ClassFunction G ℂ) = (hχ.mu : ClassFunction G ℂ).conj
    rw [← hcoe, ClassFunction.conj_conj]
  · -- Otherwise the pairing equation reads `[μ̄ = μ] − 0 = 0 − 1`, impossible.
    exfalso
    rw [if_neg hcase, if_neg (Ne.symm hχ.distinct), if_pos rfl] at hinner
    revert hinner
    split_ifs <;> intro h <;> norm_num at h

end DifferenceImageProducer

open scoped Classical in
/-- Plain-sum inner products over subsets of an orthonormal family count the overlap:
`⟨∑_{α ∈ E} α, ∑_{β ∈ F} β⟩ = |E ∩ F|` for `E, F ⊆ R` orthonormal. -/
theorem inner_sum_sum_of_orthonormal {H : Type*} [Group H] [Fintype H]
    [Invertible (Nat.card H : ℂ)] {R : Finset (ClassFunction H ℂ)}
    (horth : ∀ α ∈ R, ∀ β ∈ R, ClassFunction.inner α β = if α = β then (1 : ℂ) else 0)
    {E F : Finset (ClassFunction H ℂ)} (hE : E ⊆ R) (hF : F ⊆ R) :
    ClassFunction.inner (∑ α ∈ E, α) (∑ β ∈ F, β) = ((E ∩ F).card : ℂ) := by
  classical
  rw [inner_sum_left]
  have hterm : ∀ α ∈ E, ClassFunction.inner α (∑ β ∈ F, β)
      = if α ∈ F then (1 : ℂ) else 0 := by
    intro α hα
    rw [inner_sum_right, Finset.sum_congr rfl fun β hβ => horth α (hE hα) β (hF hβ),
      Finset.sum_ite_eq F α fun _ => (1 : ℂ)]
  rw [Finset.sum_congr rfl hterm, Finset.sum_ite_mem, Finset.sum_const, nsmul_eq_mul, mul_one]

end OddOrder.Peterfalvi.S07
Source
Yawara Ishida, Lean 4 formalization of the Feit–Thompson (odd order) theorem, github.com/yawara/odd-order @ 20a6fccbb63c (Apache-2.0), https://github.com/yawara/odd-order/blob/20a6fccbb63c0b138acda9f7fafd798c42f9441b/OddOrder/Peterfalvi/S07_Coherence/DifferenceImage.lean

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me