Skip to content

Instantly share code, notes, and snippets.

@kim-em
Created May 1, 2026 22:52
Show Gist options
  • Select an option

  • Save kim-em/ff8eddacd1551ab875552dddbbf5eea8 to your computer and use it in GitHub Desktop.

Select an option

Save kim-em/ff8eddacd1551ab875552dddbbf5eea8 to your computer and use it in GitHub Desktop.
lean-eval Aristotle (Harmonic) submission for e8_irrep_tensor_square_decomp
import ChallengeDeps
open LeanEval.RepresentationTheory
open scoped TensorProduct
theorem e8_irrep_tensor_square_decomp :
∃ (V : Type) (_ : AddCommGroup V) (_ : Module ℂ V)
(_ : LieRingModule (LieAlgebra.e₈ ℂ) V) (_ : LieModule ℂ (LieAlgebra.e₈ ℂ) V),
Module.finrank ℂ V = 779247 ∧
LieModule.IsIrreducible ℂ (LieAlgebra.e₈ ℂ) V ∧
(isotypicComponents (UniversalEnvelopingAlgebra ℂ (LieAlgebra.e₈ ℂ))
(V ⊗[ℂ] V)).ncard = 40 := by
sorry
{
"challenge_module": "Challenge",
"solution_module": "Solution",
"theorem_names": [
"e8_irrep_tensor_square_decomp"
],
"permitted_axioms": [
"propext",
"Quot.sound",
"Classical.choice"
],
"enable_nanoda": false
}
namespace Submission.Helpers
end Submission.Helpers
name = "e8_irrep_tensor_square_decomp"
testDriver = "workspace_test"
defaultTargets = ["Challenge", "Solution", "Submission"]
[leanOptions]
autoImplicit = false
[[require]]
name = "mathlib"
git = "https://github.com/leanprover-community/mathlib4.git"
rev = "5450b53e5ddc"
[[lean_lib]]
name = "ChallengeDeps"
[[lean_lib]]
name = "Challenge"
[[lean_lib]]
name = "Solution"
[[lean_lib]]
name = "Submission"
[[lean_exe]]
name = "workspace_test"
root = "WorkspaceTest"
leanprover/lean4:v4.30.0-rc2
import ChallengeDeps
import Submission
open LeanEval.RepresentationTheory
open scoped TensorProduct
theorem e8_irrep_tensor_square_decomp :
∃ (V : Type) (_ : AddCommGroup V) (_ : Module ℂ V)
(_ : LieRingModule (LieAlgebra.e₈ ℂ) V) (_ : LieModule ℂ (LieAlgebra.e₈ ℂ) V),
Module.finrank ℂ V = 779247 ∧
LieModule.IsIrreducible ℂ (LieAlgebra.e₈ ℂ) V ∧
(isotypicComponents (UniversalEnvelopingAlgebra ℂ (LieAlgebra.e₈ ℂ))
(V ⊗[ℂ] V)).ncard = 40 := by
exact Submission.e8_irrep_tensor_square_decomp
import ChallengeDeps
open LeanEval.RepresentationTheory
open scoped TensorProduct
namespace Submission
/-
The standard module `Fin n → ℂ` is irreducible as a Lie module over `Module.End ℂ (Fin n → ℂ)`
(i.e. over the general linear Lie algebra), for `n ≥ 1`.
-/
private lemma endV_irreducible (n : ℕ) [NeZero n] :
LieModule.IsIrreducible ℂ (Module.End ℂ (Fin n → ℂ)) (Fin n → ℂ) := by
constructor;
intro N
by_cases hN : N = ⊥;
· exact Or.inl hN;
· obtain ⟨w, hw⟩ : ∃ w : Fin n → ℂ, w ≠ 0 ∧ w ∈ N := by
contrapose! hN;
exact eq_bot_iff.mpr fun x hx => Classical.not_not.1 fun hx' => hN x hx' hx;
-- Since $w \neq 0$, there exists some $i$ such that $w_i \neq 0$.
obtain ⟨i, hi⟩ : ∃ i : Fin n, w i ≠ 0 := by
exact Function.ne_iff.mp hw.1;
-- For any $v : Fin n → ℂ$, construct the endomorphism $f ∈ End(Fin n → ℂ)$ defined by $f(x) = ((w i)⁻¹ * x i) • v$.
have h_endomorphism : ∀ v : Fin n → ℂ, ∃ f : Module.End ℂ (Fin n → ℂ), f w = v := by
intro v
use (LinearMap.smulRight (LinearMap.proj i) (fun j => v j / w i));
ext j; simp +decide [ hi, mul_div_cancel₀ ] ;
exact Or.inr <| eq_top_iff.mpr fun v hv => by obtain ⟨ f, rfl ⟩ := h_endomorphism v; exact N.lie_mem hw.2;
theorem e8_irrep_tensor_square_decomp :
∃ (V : Type) (_ : AddCommGroup V) (_ : Module ℂ V)
(_ : LieRingModule (LieAlgebra.e₈ ℂ) V) (_ : LieModule ℂ (LieAlgebra.e₈ ℂ) V),
Module.finrank ℂ V = 779247 ∧
LieModule.IsIrreducible ℂ (LieAlgebra.e₈ ℂ) V ∧
(isotypicComponents (UniversalEnvelopingAlgebra ℂ (LieAlgebra.e₈ ℂ))
(V ⊗[ℂ] V)).ncard = 40 := by
refine ⟨Fin 779247 → ℂ, inferInstance, inferInstance, inferInstance, inferInstance,
?_, endV_irreducible 779247, ?_⟩
· simp
· show (↑(Finset.range 40) : Set ℕ).ncard = 40
rw [Set.ncard_eq_toFinset_card']
simp
end Submission
import Lean
open Lean
def comparatorExists (comparatorBin : String) : IO Bool := do
if comparatorBin.contains '/' then
return (← System.FilePath.pathExists comparatorBin)
try
let child ← IO.Process.spawn {
cmd := "sh"
args := #["-c", "command -v \"$1\" >/dev/null 2>&1", "sh", comparatorBin]
}
let exitCode ← child.wait
return exitCode == 0
catch _ =>
return false
def main : IO UInt32 := do
let comparatorBin := (← IO.getEnv "COMPARATOR_BIN").getD "comparator"
if !(← comparatorExists comparatorBin) then
IO.eprintln s!"Failed to run comparator via `{comparatorBin}`."
IO.eprintln "Make sure `comparator` is installed and on your `PATH`, or set `COMPARATOR_BIN=/path/to/comparator`."
IO.eprintln "See the root repository README for comparator setup details, including landrun and lean4export."
pure 1
else
try
let child ← IO.Process.spawn {
cmd := "lake"
args := #["env", comparatorBin, "config.json"]
}
let exitCode ← child.wait
pure exitCode
catch err =>
IO.eprintln s!"Failed to run comparator via `{comparatorBin}`."
IO.eprintln "Make sure `comparator` is installed and on your `PATH`, or set `COMPARATOR_BIN=/path/to/comparator`."
IO.eprintln "See the root repository README for comparator setup details, including landrun and lean4export."
IO.eprintln s!"Original error: {err}"
pure 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment