Add lean source and binary files (part 3)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- lean/ComparatorChallenges/PartitionConsistency.leanAdded+324
- lean/ComparatorChallenges/PartitionPrinciple.jsonAdded+14
- lean/ComparatorChallenges/PartitionPrinciple.leanAdded+277
- lean/ComparatorChallenges/PattersonFirstMoment.jsonAdded+16
- lean/ComparatorChallenges/PattersonFirstMoment.leanAdded+99
- lean/ComparatorChallenges/PerceptronFreeEnergy.jsonAdded+14
- lean/ComparatorChallenges/PerceptronFreeEnergy.leanAdded+111
- lean/ComparatorChallenges/PerfectCompleteness.jsonAdded+14
- lean/ComparatorChallenges/PerfectCompleteness.leanAdded+185
- lean/ComparatorChallenges/PeriodicGroup.jsonAdded+14
- lean/ComparatorChallenges/PeriodicGroup.leanAdded+56
- lean/ComparatorChallenges/PeriodicTilingThree.jsonAdded+14
- lean/ComparatorChallenges/PeriodicTilingThree.leanAdded+66
- lean/ComparatorChallenges/PermanentCubic.jsonAdded+14
- lean/ComparatorChallenges/PermanentCubic.leanAdded+42
- lean/ComparatorChallenges/PettyProjectionVolume.jsonAdded+14
- lean/ComparatorChallenges/PettyProjectionVolume.leanAdded+54
- lean/ComparatorChallenges/PiExponent.jsonAdded+14
- lean/ComparatorChallenges/PiExponent.leanAdded+19
- lean/ComparatorChallenges/PinchedKahler.jsonAdded+16
- lean/ComparatorChallenges/PinchedKahler.leanAdded+159
- lean/ComparatorChallenges/PinnedDistances.jsonAdded+13
- lean/ComparatorChallenges/PinnedDistances.leanAdded+36
- lean/ComparatorChallenges/PlanarAndersonSpectrum.jsonAdded+14
- lean/ComparatorChallenges/PlanarAndersonSpectrum.leanAdded+35
- lean/ComparatorChallenges/PlanarFalconer.jsonAdded+14
- lean/ComparatorChallenges/PlanarFalconer.leanAdded+25
- lean/ComparatorChallenges/PlanarFirstPassage.jsonAdded+14
- lean/ComparatorChallenges/PlanarFirstPassage.leanAdded+102
- lean/ComparatorChallenges/PlanarL1.jsonAdded+14
- lean/ComparatorChallenges/PlanarL1.leanAdded+51
- lean/ComparatorChallenges/PlanarPacking.jsonAdded+14
- lean/ComparatorChallenges/PlanarPacking.leanAdded+40
- lean/ComparatorChallenges/PlanarUnitDistances.jsonAdded+14
- lean/ComparatorChallenges/PlanarUnitDistances.leanAdded+25
- lean/ComparatorChallenges/PlaneColoring.jsonAdded+14
- lean/ComparatorChallenges/PlaneColoring.leanAdded+21
- lean/ComparatorChallenges/PolycyclicRecognition.jsonAdded+16
- lean/ComparatorChallenges/PolycyclicRecognition.leanAdded+249
- lean/ComparatorChallenges/PosteriorReplicas.jsonAdded+14
- lean/ComparatorChallenges/PosteriorReplicas.leanAdded+455
- lean/ComparatorChallenges/PowerFreeValues.jsonAdded+14
- lean/ComparatorChallenges/PowerFreeValues.leanAdded+46
- lean/ComparatorChallenges/PrimeGaps.jsonAdded+14
- lean/ComparatorChallenges/PrimeGaps.leanAdded+47
- lean/ComparatorChallenges/ProductBrown.jsonAdded+14
- lean/ComparatorChallenges/ProductBrown.leanAdded+757
- lean/ComparatorChallenges/ProjectionCounterexample.jsonAdded+14
- lean/ComparatorChallenges/ProjectionCounterexample.leanAdded+45
- lean/ComparatorChallenges/ProjectionMoments.jsonAdded+14
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324import Mathlib
namespace OAI
namespace PartitionConsistency
/-- Pure first-order membership syntax with equality. `n` variables are in scope.A quantifier binds the last variable in its body. There are no atoms/urelements,function symbols, constants, semantic predicates, or mathematical assumptionsin this syntax. -/inductive Formula : ℕ → Type where | bot {n} : Formula n | mem {n} (x y : Fin n) : Formula n | equal {n} (x y : Fin n) : Formula n | imp {n} (p q : Formula n) : Formula n | conj {n} (p q : Formula n) : Formula n | disj {n} (p q : Formula n) : Formula n | all {n} (p : Formula (n + 1)) : Formula n | ex {n} (p : Formula (n + 1)) : Formula n
namespace Formula
abbrev neg {n} (p : Formula n) : Formula n := p.imp .botabbrev iff {n} (p q : Formula n) : Formula n := (p.imp q).conj (q.imp p)
/-- Under a binder, a renaming leaves the newly bound variable bound. -/def liftRen {n m} (r : Fin n → Fin m) : Fin (n + 1) → Fin (m + 1) := Fin.lastCases (Fin.last m) (fun i => (r i).castSucc)
/-- Capture-avoiding renaming; in this relational language all terms are variables. -/def rename {n m} (r : Fin n → Fin m) : Formula n → Formula m | .bot => .bot | .mem x y => .mem (r x) (r y) | .equal x y => .equal (r x) (r y) | .imp p q => .imp (rename r p) (rename r q) | .conj p q => .conj (rename r p) (rename r q) | .disj p q => .disj (rename r p) (rename r q) | .all p => .all (rename (liftRen r) p) | .ex p => .ex (rename (liftRen r) p)
abbrev raise {n} (p : Formula n) : Formula (n + 1) := rename Fin.castSucc p
/-- Substitution of a variable term for the variable just quantified. -/def instantiate {n} (p : Formula (n + 1)) (x : Fin n) : Formula n := rename (Fin.lastCases x id) p
/-- Universal closure of all the free variables. -/def close : {n : ℕ} → Formula n → Formula 0 | 0, p => p | _ + 1, p => close (.all p)
end Formula
abbrev Sentence := Formula 0abbrev Theory := Set Sentence
/-- Classical first-order natural deduction with equality. Hypotheses may be aninfinite theory, but a derivation is a finite inductive proof. The `allI` and`exE` rules use a fresh last variable, and shift all assumptions to avoidcapture. We allow finitely many free variables in proofs of closed sentences. -/inductive Derives : {n : ℕ} → Set (Formula n) → Formula n → Prop where | hyp {n} {Γ : Set (Formula n)} {p} : p ∈ Γ → Derives Γ p | weaken {n} {Γ Δ : Set (Formula n)} {p} : Γ ⊆ Δ → Derives Γ p → Derives Δ p | impI {n} {Γ : Set (Formula n)} {p q} : Derives (insert p Γ) q → Derives Γ (.imp p q) | impE {n} {Γ : Set (Formula n)} {p q} : Derives Γ (.imp p q) → Derives Γ p → Derives Γ q | botE {n} {Γ : Set (Formula n)} {p} : Derives Γ .bot → Derives Γ p | classical {n} {Γ : Set (Formula n)} {p} : Derives (insert p.neg Γ) .bot → Derives Γ p | conjI {n} {Γ : Set (Formula n)} {p q} : Derives Γ p → Derives Γ q → Derives Γ (.conj p q) | conjL {n} {Γ : Set (Formula n)} {p q} : Derives Γ (.conj p q) → Derives Γ p | conjR {n} {Γ : Set (Formula n)} {p q} : Derives Γ (.conj p q) → Derives Γ q | disjL {n} {Γ : Set (Formula n)} {p q} : Derives Γ p → Derives Γ (.disj p q) | disjR {n} {Γ : Set (Formula n)} {p q} : Derives Γ q → Derives Γ (.disj p q) | disjE {n} {Γ : Set (Formula n)} {p q r} : Derives Γ (.disj p q) → Derives (insert p Γ) r → Derives (insert q Γ) r → Derives Γ r | allI {n} {Γ : Set (Formula n)} {p : Formula (n + 1)} : Derives (Formula.raise '' Γ) p → Derives Γ (.all p) | allE {n} {Γ : Set (Formula n)} {p : Formula (n + 1)} (t : Fin n) : Derives Γ (.all p) → Derives Γ (p.instantiate t) | exI {n} {Γ : Set (Formula n)} {p : Formula (n + 1)} (t : Fin n) : Derives Γ (p.instantiate t) → Derives Γ (.ex p) | exE {n} {Γ : Set (Formula n)} {p : Formula (n + 1)} {q : Formula n} : Derives Γ (.ex p) → Derives (insert p (Formula.raise '' Γ)) q.raise → Derives Γ q | eqRefl {n} {Γ : Set (Formula n)} (t : Fin n) : Derives Γ (.equal t t) | eqSubst {n} {Γ : Set (Formula n)} {s t : Fin n} (p : Formula (n + 1)) : Derives Γ (.equal s t) → Derives Γ (p.instantiate s) → Derives Γ (p.instantiate t) | rename {n m} {Γ : Set (Formula n)} {p : Formula n} (r : Fin n → Fin m) : Derives Γ p → Derives (Formula.rename r '' Γ) (Formula.rename r p)
/-- Sentences are usable as open hypotheses with any finite supply of variables. -/def Theory.at (T : Theory) (n : ℕ) : Set (Formula n) := Formula.rename Fin.elim0 '' T
/-- Ordinary syntactic consistency: there is no finite natural-deduction proofof falsity from the theory, with any finite supply of free variables. -/def Consistent (T : Theory) : Prop := ∀ n, ¬ Derives (T.at n) .bot
namespace SetLanguageopen Formula
/-! All abbreviations in this namespace expand to formulas of the pure languageof equality and membership. Functions are sets of Kuratowski pairs *inside thestructure*. In particular, no quantification over external Lean functions isused in PP, Choice, or ordinal-indexed Choice. -/
/-- `a ⊆ b`. -/def subset {n} (a b : Fin n) : Formula n := rename ![a, b] (Formula.all ((Formula.mem 2 0).imp (Formula.mem 2 1)) : Formula 2)
/-- `a = ∅`. -/def empty {n} (a : Fin n) : Formula n := rename ![a] (Formula.all (Formula.mem 1 0).neg : Formula 1)
/-- `a ≠ ∅`, stated as existence of a member. -/def nonempty {n} (a : Fin n) : Formula n := rename ![a] (Formula.ex (Formula.mem 1 0) : Formula 1)
/-- `p = {x,y}`. -/def unorderedPair {n} (p x y : Fin n) : Formula n := rename ![p, x, y] (Formula.all ((Formula.mem 3 0).iff ((Formula.equal 3 1).disj (Formula.equal 3 2))) : Formula 3)
/-- `b = a ∪ {a}`. -/def successor {n} (b a : Fin n) : Formula n := rename ![b, a] (Formula.all ((Formula.mem 2 0).iff ((Formula.mem 2 1).disj (Formula.equal 2 1))) : Formula 2)
/-- Kuratowski ordered pair: `p = {{x},{x,y}}`. -/def orderedPair {n} (p x y : Fin n) : Formula n := rename ![p, x, y] (Formula.ex (Formula.ex ((unorderedPair 3 1 1).conj ((unorderedPair 4 1 2).conj (unorderedPair 0 3 4)))) : Formula 3)
/-- The internal graph relation `⟨x,y⟩ ∈ f`. -/def edge {n} (f x y : Fin n) : Formula n := rename ![f, x, y] (Formula.ex ((Formula.mem 3 0).conj (orderedPair 3 1 2)) : Formula 3)
/-- `f` is a set graph of a function whose domain is exactly `d`.The first conjunct excludes non-pairs and graph entries outside the domain;the second conjunct asserts totality and single-valuedness. -/def functionOn {n} (f d : Fin n) : Formula n := rename ![f, d] ((Formula.all ((Formula.mem 2 0).imp (Formula.ex (Formula.ex ((Formula.mem 3 1).conj (orderedPair 2 3 4)))))).conj (Formula.all ((Formula.mem 2 1).imp (Formula.ex ((edge 0 2 3).conj (Formula.all ((edge 0 2 4).imp (Formula.equal 4 3))))))) : Formula 2)
/-- Internal set function `f : d → r`. -/def mapsTo {n} (f d r : Fin n) : Formula n := rename ![f, d, r] ((functionOn 0 1).conj (Formula.all (Formula.all ((Formula.mem 3 1).imp ((edge 0 3 4).imp (Formula.mem 4 2))))) : Formula 3)
/-- Internal set surjection `f : d ↠ r`. -/def surjection {n} (f d r : Fin n) : Formula n := rename ![f, d, r] ((mapsTo 0 1 2).conj (Formula.all ((Formula.mem 3 2).imp (Formula.ex ((Formula.mem 4 1).conj (edge 0 4 3))))) : Formula 3)
/-- Internal set injection `f : d ↪ r`. -/def injection {n} (f d r : Fin n) : Formula n := rename ![f, d, r] ((mapsTo 0 1 2).conj (Formula.all (Formula.all (.all ((Formula.mem 3 1).imp ((Formula.mem 4 1).imp (((edge 0 3 5).conj (edge 0 4 5)).imp (Formula.equal 3 4))))))) : Formula 3)
/-- Transitivity of a set (not transitivity of the external structure). -/def transitiveSet {n} (a : Fin n) : Formula n := rename ![a] (Formula.all (Formula.all ((Formula.mem 1 0).imp ((Formula.mem 2 1).imp (Formula.mem 2 0)))) : Formula 1)
/-- Membership is an internal strict linear order on `a`. -/def membershipLinear {n} (a : Fin n) : Formula n := rename ![a] ((Formula.all ((Formula.mem 1 0).imp (Formula.mem 1 1).neg)).conj ((Formula.all (Formula.all (Formula.all ((Formula.mem 1 0).imp ((Formula.mem 2 0).imp ((Formula.mem 3 0).imp (((Formula.mem 1 2).conj (Formula.mem 2 3)).imp (Formula.mem 1 3)))))))).conj (Formula.all (Formula.all ((Formula.mem 1 0).imp ((Formula.mem 2 0).imp ((Formula.equal 1 2).disj ((Formula.mem 1 2).disj (Formula.mem 2 1)))))))) : Formula 1)
/-- Every nonempty internal subset of `a` has a membership-minimal element.This does NOT assert external well-foundedness of the relation. -/def membershipWellFounded {n} (a : Fin n) : Formula n := rename ![a] (Formula.all (((subset 1 0).conj (nonempty 1)).imp (Formula.ex ((Formula.mem 2 1).conj (Formula.all ((Formula.mem 3 1).imp (Formula.mem 3 2).neg))))) : Formula 1)
/-- A von Neumann ordinal: a transitive set internally wellordered by membership. -/def ordinal {n} (a : Fin n) : Formula n := (transitiveSet a).conj ((membershipLinear a).conj (membershipWellFounded a))
/-- A choice function on the set `A` of nonempty sets. -/def choiceOn {n} (c A : Fin n) : Formula n := rename ![c, A] ((functionOn 0 1).conj (Formula.all ((Formula.mem 2 1).imp (Formula.ex ((edge 0 2 3).conj (Formula.mem 3 2))))) : Formula 2)
/-- A graph `F` coding a family of nonempty sets indexed by ordinal `η`. -/def nonemptyFamily {n} (F η : Fin n) : Formula n := rename ![F, η] ((functionOn 0 1).conj (Formula.all (Formula.all ((Formula.mem 2 1).imp ((edge 0 2 3).imp (nonempty 3))))) : Formula 2)
/-- `c(ξ) ∈ F(ξ)` for every `ξ ∈ η`, with `c` an internal function. -/def choiceForFamily {n} (c η F : Fin n) : Formula n := rename ![c, η, F] ((functionOn 0 1).conj (Formula.all (Formula.all ((Formula.mem 3 1).imp ((edge 2 3 4).imp (Formula.ex ((edge 0 3 5).conj (Formula.mem 5 4))))))) : Formula 3)
/-- The Partition Principle. The reverse injection is not required to be asection of the original surjection. Both `X` and `Y` range over all sets. -/def PP : Sentence := Formula.all (Formula.all ((Formula.ex (surjection 2 0 1)).imp (Formula.ex (injection 2 1 0))))
/-- Ordinary Choice for every set of nonempty sets. -/def AC : Sentence := Formula.all ((Formula.all ((Formula.mem 1 0).imp (nonempty 1))).imp (Formula.ex (choiceOn 1 0)))
/-- Choice for every ordinal-indexed family of nonempty sets, including ordinalswhich may fail to be well founded from outside a model. -/def ACwo : Sentence := Formula.all ((ordinal 0).imp (Formula.all ((nonemptyFamily 1 0).imp (Formula.ex (choiceForFamily 2 0 1)))))
/-! Full pure-set ZF, not a finite fragment and not ZFA. -/
def extensionality : Sentence := Formula.all (Formula.all ((Formula.all ((Formula.mem 2 0).iff (Formula.mem 2 1))).imp (Formula.equal 0 1)))
def emptySet : Sentence := Formula.ex (empty 0)
def pairing : Sentence := Formula.all (Formula.all (Formula.ex (unorderedPair 2 0 1)))
def union : Sentence := Formula.all (Formula.ex (Formula.all ((Formula.mem 2 1).iff (Formula.ex ((Formula.mem 3 0).conj (Formula.mem 2 3))))))
def powerSet : Sentence := Formula.all (Formula.ex (Formula.all ((Formula.mem 2 1).iff (subset 2 0))))
def infinity : Sentence := Formula.ex ((Formula.ex ((Formula.mem 1 0).conj (empty 1))).conj (Formula.all ((Formula.mem 1 0).imp (Formula.ex ((Formula.mem 2 0).conj (successor 2 1))))))
def foundation : Sentence := Formula.all ((nonempty 0).imp (Formula.ex ((Formula.mem 1 0).conj (Formula.all ((Formula.mem 2 1).imp (Formula.mem 2 0).neg)))))
/-- The instance of Separation for an entirely arbitrary formula `p(params,x)`.All parameters are universally closed. Neither the quantifier complexity of`p` nor the number of parameters is bounded. -/def separation {n} (p : Formula (n + 1)) : Sentence := let A : Fin (n + 3) := (Fin.last n).castSucc.castSucc let B : Fin (n + 3) := (Fin.last (n + 1)).castSucc let x : Fin (n + 3) := Fin.last (n + 2) let r : Fin (n + 1) → Fin (n + 3) := Fin.lastCases x (fun i => i.castSucc.castSucc.castSucc) close (Formula.all (Formula.ex (Formula.all ((Formula.mem x B).iff ((Formula.mem x A).conj (rename r p))))))
/-- Substitution into a binary formula with `n` additional parameters. -/def relation {n m} (p : Formula (n + 2)) (params : Fin n → Fin m) (x y : Fin m) : Formula m := rename (Fin.lastCases y (Fin.lastCases x params)) p
/-- The instance of Replacement for an entirely arbitrary formula`p(params,x,y)`: if it is single-valued and total on `A`, its image is a set.As with Separation, the parameters are all universally closed. -/def replacement {n} (p : Formula (n + 2)) : Sentence := let unique : Formula (n + 3) := Formula.all ((relation p (fun i => i.castSucc.castSucc.castSucc.castSucc) (Fin.last (n + 1)).castSucc.castSucc (Fin.last (n + 3))).imp (Formula.equal (Fin.last (n + 3)) (Fin.last (n + 2)).castSucc)) let totalFunctional : Formula (n + 1) := Formula.all ((Formula.mem (Fin.last (n + 1)) (Fin.last n).castSucc).imp (Formula.ex ((relation p (fun i => i.castSucc.castSucc.castSucc) (Fin.last (n + 1)).castSucc (Fin.last (n + 2))).conj unique))) let image : Formula (n + 1) := Formula.ex (Formula.all ((Formula.mem (Fin.last (n + 2)) (Fin.last (n + 1)).castSucc).iff (Formula.ex ((Formula.mem (Fin.last (n + 3)) (Fin.last n).castSucc.castSucc.castSucc).conj (relation p (fun i => i.castSucc.castSucc.castSucc.castSucc) (Fin.last (n + 3)) (Fin.last (n + 2)).castSucc))))) close (Formula.all (totalFunctional.imp image))
/-- Exactly the axioms and all schema instances of pure first-order ZF. -/inductive IsZFAxiom : Sentence → Prop where | extensionality : IsZFAxiom extensionality | emptySet : IsZFAxiom emptySet | pairing : IsZFAxiom pairing | union : IsZFAxiom union | powerSet : IsZFAxiom powerSet | infinity : IsZFAxiom infinity | foundation : IsZFAxiom foundation | separation {n} (p : Formula (n + 1)) : IsZFAxiom (separation p) | replacement {n} (p : Formula (n + 2)) : IsZFAxiom (replacement p)
/-- Zermelo–Fraenkel set theory, without Choice. -/def ZF : Theory := {p | IsZFAxiom p}
/-- ZF with the Partition Principle, ordinal-indexed Choice and failure of Choice. -/def targetTheory : Theory := ZF ∪ {PP, ACwo, AC.neg}
end SetLanguage
/-- Relative consistency of ZF with the Partition Principle, ordinal-indexedChoice and failure of Choice. -/theorem main_consistency : Consistent SetLanguage.ZF → Consistent SetLanguage.targetTheory := by sorry
end PartitionConsistency
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PartitionPrinciple", "solution_module": "OAI.SetTheory.PartitionPrinciple.Main", "theorem_names": [ "OAI.PartitionPilot.Forcing.TransitiveGround.exists_model_partitionPrinciple_without_choice" ], "definition_names": [], "enable_nanoda": false, "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277import Mathlib
namespace OAI
namespace PartitionPilot.Forcing
universe u
inductive SetFormula : Nat → Type | equal {n} : Fin n → Fin n → SetFormula n | mem {n} : Fin n → Fin n → SetFormula n | neg {n} : SetFormula n → SetFormula n | conj {n} : SetFormula n → SetFormula n → SetFormula n | all {n} : SetFormula (n + 1) → SetFormula n
namespace SetFormula
def extend {A : Type u} {n : Nat} (x : A) (env : Fin n → A) : Fin (n + 1) → A := Fin.cases x env
def Realize (U : Set ZFSet.{u}) : {n : Nat} → SetFormula n → (Fin n → ZFSet.{u}) → Prop | _, .equal i j, env => env i = env j | _, .mem i j, env => env i ∈ env j | _, .neg φ, env => ¬ Realize U φ env | _, .conj φ ψ, env => Realize U φ env ∧ Realize U ψ env | _, .all φ, env => ∀ x ∈ U, Realize U φ (extend x env)
def ex {n : Nat} (φ : SetFormula (n + 1)) : SetFormula n := .neg (.all (.neg φ))
def disj {n : Nat} (φ ψ : SetFormula n) : SetFormula n := .neg (.conj (.neg φ) (.neg ψ))
def imp {n : Nat} (φ ψ : SetFormula n) : SetFormula n := .neg (.conj φ (.neg ψ))
end SetFormula
inductive BoundedFormula : Nat → Type | equal {n} : Fin n → Fin n → BoundedFormula n | mem {n} : Fin n → Fin n → BoundedFormula n | neg {n} : BoundedFormula n → BoundedFormula n | conj {n} : BoundedFormula n → BoundedFormula n → BoundedFormula n | allMem {n} : Fin n → BoundedFormula (n + 1) → BoundedFormula n
namespace BoundedFormula
open SetFormula
def imp {n} (φ ψ : BoundedFormula n) : BoundedFormula n := .neg (.conj φ (.neg ψ))
def disj {n} (φ ψ : BoundedFormula n) : BoundedFormula n := .neg (.conj (.neg φ) (.neg ψ))
def exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) : BoundedFormula n := .neg (.allMem b (.neg φ))
def toFormula : {n : Nat} → BoundedFormula n → SetFormula n | _, .equal i j => .equal i j | _, .mem i j => .mem i j | _, .neg φ => .neg φ.toFormula | _, .conj φ ψ => .conj φ.toFormula ψ.toFormula | _, .allMem b φ => .all (SetFormula.imp (.mem 0 b.succ) φ.toFormula)
def singletonFormula {n} (z x : Fin n) : BoundedFormula n := .conj (.mem x z) (.allMem z (.equal 0 x.succ))
def unorderedPairFormula {n} (z x y : Fin n) : BoundedFormula n := .conj (.mem x z) (.conj (.mem y z) (.allMem z (disj (.equal 0 x.succ) (.equal 0 y.succ))))
def orderedPairFormula {n} (z x y : Fin n) : BoundedFormula n := exMem z (.conj (singletonFormula 0 x.succ) (exMem z.succ (.conj (unorderedPairFormula 0 x.succ.succ y.succ.succ) (unorderedPairFormula z.succ.succ 1 0))))
def pairMembershipFormula {n} (x y r : Fin n) : BoundedFormula n := exMem r (orderedPairFormula 0 x.succ y.succ)
def relationBetweenFormula {n} (a b f : Fin n) : BoundedFormula n := .allMem f (exMem a.succ (exMem b.succ.succ (orderedPairFormula 2 1 0)))
def functionFormula {n} (a b f : Fin n) : BoundedFormula n := .conj (relationBetweenFormula a b f) (.allMem a (exMem b.succ (.conj (pairMembershipFormula 1 0 f.succ.succ) (.allMem b.succ.succ (imp (pairMembershipFormula 2 0 f.succ.succ.succ) (.equal 0 1))))))
def nonemptyFormula {n} (x : Fin n) : BoundedFormula n := exMem x (.equal 0 0)
def choiceFunctionFormula {n} (a f : Fin n) : BoundedFormula n := .conj (.allMem f (exMem a.succ (exMem 0 (orderedPairFormula 2 1 0)))) (.allMem a (exMem 0 (.conj (pairMembershipFormula 1 0 f.succ.succ) (.allMem 1 (imp (pairMembershipFormula 2 0 f.succ.succ.succ) (.equal 0 1))))))
end BoundedFormula
structure TransitiveGround where sets : Set ZFSet.{u} transitive : ∀ {x y}, x ∈ sets → y ∈ x → y ∈ sets
structure InjectionCode (D N f : ZFSet.{u}) : Prop where function : ZFSet.IsFunc D N f injective : ∀ x y z, ZFSet.pair x z ∈ f → ZFSet.pair y z ∈ f → x = y
namespace TransitiveGround
open SetFormula
variable (M : TransitiveGround.{u})
def groundEmbeddable (D N : ZFSet.{u}) : Prop := ∃ f ∈ M.sets, InjectionCode D N f
end TransitiveGround
def setTransitive (x : ZFSet.{u}) : Prop := ∀ y ∈ x, ∀ z ∈ y, z ∈ x
def ordinalSetProperty (x : ZFSet.{u}) : Prop := setTransitive x ∧ ∀ y ∈ x, setTransitive y
namespace TransitiveGround
open SetFormula
variable (M : TransitiveGround.{u})
noncomputable def groundPower (B : ZFSet.{u}) : ZFSet.{u} := ZFSet.sep (fun p => p ∈ M.sets) (ZFSet.powerset B)
end TransitiveGround
def GroundBelow (M : TransitiveGround.{u}) (A K : ZFSet.{u}) : Prop := ∃ β ∈ K, M.groundEmbeddable A β
def GroundCardinal (M : TransitiveGround.{u}) (κ : ZFSet.{u}) : Prop := ordinalSetProperty κ ∧ ∀ β ∈ κ, ¬ M.groundEmbeddable κ β
def CofinalFunctionCode (α K f : ZFSet.{u}) : Prop := ZFSet.IsFunc α K f ∧ ∀ β ∈ K, ∃ x ∈ α, ∃ y ∈ K, ZFSet.pair x y ∈ f ∧ (β = y ∨ β ∈ y)
def GroundCofinalRegular (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := ∀ α ∈ K, ∀ f ∈ M.sets, ¬ CofinalFunctionCode α K f
def GroundCardinalStrongLimit (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := ∀ κ ∈ K, GroundCardinal M κ → GroundBelow M (M.groundPower κ) K
def GroundStandardInaccessible (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := GroundCardinal M K ∧ ¬ M.groundEmbeddable K ZFSet.omega ∧ GroundCofinalRegular M K ∧ GroundCardinalStrongLimit M K
namespace SetFormula
def extensionality : SetFormula 0 := .all (.all (imp (.all (.conj (imp (.mem 0 2) (.mem 0 1)) (imp (.mem 0 1) (.mem 0 2)))) (.equal 1 0)))
def foundation : SetFormula 0 := .all (imp (ex (.mem 0 1)) (ex (.conj (.mem 0 1) (.all (.neg (.conj (.mem 0 2) (.mem 0 1)))))))
def emptySet : SetFormula 0 := ex (.all (.neg (.mem 0 1)))
def pairing : SetFormula 0 := .all (.all (ex (.all (.conj (imp (.mem 0 1) (disj (.equal 0 3) (.equal 0 2))) (imp (disj (.equal 0 3) (.equal 0 2)) (.mem 0 1))))))
def union : SetFormula 0 := .all (ex (.all (.conj (imp (.mem 0 1) (ex (.conj (.mem 0 3) (.mem 1 0)))) (imp (ex (.conj (.mem 0 3) (.mem 1 0))) (.mem 0 1)))))
def powerSet : SetFormula 0 := .all (ex (.all (.conj (imp (.mem 0 1) (.all (imp (.mem 0 1) (.mem 0 3)))) (imp (.all (imp (.mem 0 1) (.mem 0 3))) (.mem 0 1)))))
def SeparationSchema (U : Set ZFSet.{u}) : Prop := ∀ {n} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}), (∀ i, params i ∈ U) → ∀ x ∈ U, ∃ y ∈ U, ∀ z ∈ U, z ∈ y ↔ z ∈ x ∧ Realize U φ (extend z params)
def CollectionSchema (U : Set ZFSet.{u}) : Prop := ∀ {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}), (∀ i, params i ∈ U) → ∀ a ∈ U, (∀ x ∈ U, x ∈ a → ∃ y ∈ U, Realize U φ (extend x (extend y params))) → ∃ b ∈ U, ∀ x ∈ U, x ∈ a → ∃ y ∈ U, y ∈ b ∧ Realize U φ (extend x (extend y params))
def emptySetFormula {n : Nat} (x : Fin n) : SetFormula n := .all (.neg (.mem 0 x.succ))
def successorFormula {n : Nat} (y x : Fin n) : SetFormula n := .all (.conj (imp (.mem 0 y.succ) (disj (.equal 0 x.succ) (.mem 0 x.succ))) (imp (disj (.equal 0 x.succ) (.mem 0 x.succ)) (.mem 0 y.succ)))
def infinity : SetFormula 0 := ex (.conj (ex (.conj (.mem 0 1) (emptySetFormula 0))) (.all (imp (.mem 0 1) (ex (.conj (.mem 0 2) (successorFormula 0 1))))))
def choice : SetFormula 0 := .all (imp (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula (ex (BoundedFormula.choiceFunctionFormula 1 0).toFormula))
def ReplacementSchema (U : Set ZFSet.{u}) : Prop := ∀ {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}), (∀ i, params i ∈ U) → ∀ A ∈ U, (∀ x ∈ U, x ∈ A → ∃ y ∈ U, Realize U φ (extend x (extend y params)) ∧ ∀ z ∈ U, Realize U φ (extend x (extend z params)) → z = y) → ∃ B ∈ U, ∀ y ∈ U, y ∈ B ↔ ∃ x ∈ U, x ∈ A ∧ Realize U φ (extend x (extend y params))
def finiteZFAxioms : SetFormula 0 := .conj extensionality (.conj foundation (.conj emptySet (.conj pairing (.conj SetFormula.union (.conj powerSet infinity)))))
def ZFRealization (U : Set ZFSet.{u}) : Prop := Realize U finiteZFAxioms Fin.elim0 ∧ SeparationSchema U ∧ ReplacementSchema U
end SetFormula
namespace BoundedFormula
open SetFormula
def injectionFormula {n} (d c f : Fin n) : BoundedFormula n := .conj (functionFormula d c f) (.allMem d (.allMem d.succ (.allMem c.succ.succ (imp (.conj (pairMembershipFormula 2 0 f.succ.succ.succ) (pairMembershipFormula 1 0 f.succ.succ.succ)) (.equal 2 1)))))
end BoundedFormula
namespace SetFormula
def hasInjectionFormula {n} (d c : Fin n) : SetFormula n := ex (BoundedFormula.injectionFormula d.succ c.succ 0).toFormula
end SetFormula
namespace BoundedFormula
open SetFormula
def surjectionFormula {n : Nat} (a b f : Fin n) : BoundedFormula n := .conj (functionFormula a b f) (.allMem b (exMem a.succ (pairMembershipFormula 0 1 f.succ.succ)))
end BoundedFormula
namespace SetFormula
def partitionPrinciple : SetFormula 0 := .all (.all (.all (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula (hasInjectionFormula (n := 3) 1 2))))
end SetFormula
end PartitionPilot.Forcing
namespace PartitionPilot.Forcing.TransitiveGround
open SetFormula
universe u
variable (M : TransitiveGround.{u})
theorem exists_model_partitionPrinciple_without_choice (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (unions : Realize M.sets SetFormula.union Fin.elim0) (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets �� Realize N.sets partitionPrinciple Fin.elim0 ∧ ¬ Realize N.sets SetFormula.choice Fin.elim0 := by sorry
end PartitionPilot.Forcing.TransitiveGround
end OAI12345678910111213141516{ "challenge_module": "ComparatorChallenges.PattersonFirstMoment", "solution_module": "OAI.NumberTheory.CubicMoment.Theta.CubicThetaMains", "theorem_names": [ "OAI.CubicFirstMoment.patterson_firstMoment", "OAI.CubicFirstMoment.patterson_angularComparison", "OAI.CubicFirstMoment.patterson_angularCancellation" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899import Mathlib
namespace OAI
/-! Primary Eisenstein elements, residue characters, Gauss sums and first-moment target definitions. -/
section
noncomputable sectionopen scoped BigOperatorsopen Moduleattribute [local instance] Classical.propDecidable
namespace CubicFirstMoment
def omega : ℂ := Complex.exp (2 * (Real.pi : ℂ) * Complex.I / 3)
def eisensteinRing : Subalgebra ℤ ℂ := Algebra.adjoin ℤ {omega}abbrev Eisenstein := eisensteinRing
def omegaE : Eisenstein := ⟨omega, Algebra.subset_adjoin (Set.mem_singleton omega)⟩
def norm (a : Eisenstein) : ℝ := Complex.normSq (a : ℂ)
def normNat (a : Eisenstein) : ℕ := ⌊norm a⌋₊
def primary (a : Eisenstein) : Prop := (3 : Eisenstein) ∣ a - 1
def primaryPrime (a : Eisenstein) : Prop := primary a ∧ Prime a
def modulus (a : Eisenstein) : Ideal Eisenstein := Ideal.span {a}
abbrev Residues (a : Eisenstein) := Eisenstein ⧸ modulus a
def residueRepresentative (a : Eisenstein) (v : Residues a) : Eisenstein := Classical.choose (Ideal.Quotient.mk_surjective v)
def cubicSymbolAtPrime (p v : Eisenstein) : ℂ := if IsUnit (Ideal.Quotient.mk (modulus p) v) then if h : ∃ j : Fin 3, Ideal.Quotient.mk (modulus p) (v ^ ((normNat p - 1) / 3)) = Ideal.Quotient.mk (modulus p) (omegaE ^ (j : ℕ)) then omega ^ ((Classical.choose h : Fin 3) : ℕ) else 0 else 0
def additivePhase (p v : Eisenstein) : ℂ := let z : ℂ := (v : ℂ) / (p : ℂ) Complex.exp (2 * (Real.pi : ℂ) * Complex.I * (z + star z))
def gaussAtPrime (p : Eisenstein) : ℂ := (Real.sqrt (norm p) : ℂ)⁻¹ * ∑' v : Residues p, cubicSymbolAtPrime p (residueRepresentative p v) * additivePhase p (residueRepresentative p v)
def cStar : ℝ := (2 * Real.pi) ^ (2 / 3 : ℝ) / (3 * Real.Gamma (2 / 3))
def primeCutoffSum (f : Eisenstein → ℂ) (X : ℝ) : ℂ := ∑' p : Eisenstein, if primaryPrime p ∧ norm p ≤ X then f p else 0
def firstMomentScale (X : ℝ) : ℝ := X ^ (5 / 6 : ℝ) / Real.log X
def FirstMomentStatement : Prop := Asymptotics.IsLittleO Filter.atTop (fun X : ℝ => primeCutoffSum gaussAtPrime X - (((6 / 5 : ℝ) * cStar * firstMomentScale X : ℝ) : ℂ)) firstMomentScale
def theta (ℓ : ℤ) (a : Eisenstein) : ℂ := ((a : ℂ) / (‖(a : ℂ)‖ : ℂ)) ^ ℓ
def AngularComparisonStatement : Prop := ∀ ℓ : ℤ, Asymptotics.IsLittleO Filter.atTop (primeCutoffSum (fun p => theta ℓ p * (gaussAtPrime p - ((cStar * norm p ^ (-1 / 6 : ℝ) : ℝ) : ℂ)))) firstMomentScale
def AngularCancellationStatement : Prop := ∀ ℓ : ℤ, ℓ ≠ 0 → Asymptotics.IsLittleO Filter.atTop (primeCutoffSum (fun p => theta ℓ p * gaussAtPrime p)) firstMomentScale
/-- The sharp first moment over all primary Eisenstein primes. -/theorem patterson_firstMoment : FirstMomentStatement := by sorry
/-- Model comparison in every fixed integer angular mode. -/theorem patterson_angularComparison : AngularComparisonStatement := by sorry
/-- Cancellation at the first-moment scale for each nonzero angular mode. -/theorem patterson_angularCancellation : AngularCancellationStatement := by sorry
end CubicFirstMomentendend
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PerceptronFreeEnergy", "solution_module": "OAI.Probability.Perceptron.Main", "theorem_names": [ "OAI.SphericalPerceptronFreeEnergy.main" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111import Mathlib
namespace OAI
noncomputable sectionopen MeasureTheory ProbabilityTheory Filter Setopen scoped ENNReal NNReal Topology BigOperators BoundedContinuousFunction
namespace SphericalPerceptronFreeEnergy
abbrev Time := unitIntervalabbrev BrownianPath := C(ℝ≥0, ℝ)
instance : MeasurableSpace BrownianPath := borel BrownianPathinstance : BorelSpace BrownianPath := ⟨rfl⟩
abbrev Spin (N : ℕ) := EuclideanSpace ℝ (Fin N)
def patternCount (α : ℝ) (N : ℕ) : ℕ := ⌊α * (N : ℝ)⌋₊abbrev Patterns (α : ℝ) (N : ℕ) := Fin (patternCount α N) → Fin N → ℝ
def patternLaw (α : ℝ) (N : ℕ) : Measure (Patterns α N) := Measure.pi fun _ => Measure.pi fun _ => gaussianReal 0 1
def unitSphereLaw (N : ℕ) : Measure (Metric.sphere (0 : Spin N) 1) := let s := (volume : Measure (Spin N)).toSphere (s Set.univ)⁻¹ • s
def sphereLaw (N : ℕ) : Measure (Spin N) := (unitSphereLaw N).map fun x => Real.sqrt (N : ℝ) • x.val
def patternField {α : ℝ} {N : ℕ} (g : Patterns α N) (a : Fin (patternCount α N)) (x : Spin N) : ℝ := (∑ i : Fin N, g a i * x i) / Real.sqrt (N : ℝ)
def hamiltonian (α : ℝ) (φ : ℝ →ᵇ ℝ) (N : ℕ) (g : Patterns α N) (x : Spin N) : ℝ := ∑ a : Fin (patternCount α N), φ (patternField g a x)
def pressure (α β : ℝ) (φ : ℝ →ᵇ ℝ) (N : ℕ) (g : Patterns α N) : ℝ := Real.log (∫ x, Real.exp (β * hamiltonian α φ N g x) ∂sphereLaw N) / (N : ℝ)
def expectedPressure (α β : ℝ) (φ : ℝ →ᵇ ℝ) (N : ℕ) : ℝ := ∫ g, pressure α β φ N g ∂patternLaw α N
structure Trial where toFun : Time → ℝ monotone : Monotone toFun measurable : Measurable toFun nonneg : ∀ t, 0 ≤ toFun t le_one : ∀ t, toFun t ≤ 1
instance : CoeFun Trial (fun _ => Time → ℝ) := ⟨Trial.toFun⟩
def timeLaw : Measure Time := Measure.comap Subtype.val volume
def tailIntegral (m : Trial) (t : Time) : ℝ := ∫ s in Set.Ici t, m s ∂timeLaw
def entropy (m : Trial) : ℝ≥0∞ := (∫⁻ t, (ENNReal.ofReal (tailIntegral m t))⁻¹ - (ENNReal.ofReal (1 - (t : ℝ)))⁻¹ ∂timeLaw) / 2
def brownianEval (t : ℝ≥0) (ω : BrownianPath) : ℝ := ω t
@[instance_reducible] def nullSigma (P : Measure BrownianPath) : MeasurableSpace BrownianPath := MeasurableSpace.generateFrom {s | P s = 0}
@[instance_reducible] def usualBrownianSigma (P : Measure BrownianPath) (t : Time) : MeasurableSpace BrownianPath := ⨅ s : {s : ℝ≥0 // (t : ℝ) < s}, (⨆ r : {r : ℝ≥0 // r ≤ s.val}, MeasurableSpace.comap (brownianEval r.val) (borel ℝ)) ⊔ nullSigma P
def Progressive (P : Measure BrownianPath) (v : Time → BrownianPath → ℝ) : Prop := ∀ t : Time, @Measurable (Set.Iic t × BrownianPath) ℝ (MeasurableSpace.prod inferInstance (usualBrownianSigma P t)) (borel ℝ) (fun p => v p.1.val p.2)
def controlCost (P : Measure BrownianPath) (m : Trial) (v : Time → BrownianPath → ℝ) : ℝ≥0∞ := ∫⁻ ω, ∫⁻ t, ENNReal.ofReal (m t * v t ω ^ 2) ∂timeLaw ∂P
def controlPayoff (P : Measure BrownianPath) (f : ℝ →ᵇ ℝ) (m : Trial) (v : Time → BrownianPath → ℝ) : ℝ := (∫ ω, f (brownianEval 1 ω + ∫ t, m t * v t ω ∂timeLaw) ∂P) - (controlCost P m v).toReal / 2
def controlValue (P : Measure BrownianPath) (f : ℝ →ᵇ ℝ) (m : Trial) : ℝ := sSup {a | ∃ v : Time → BrownianPath → ℝ, Progressive P v ∧ controlCost P m v < ∞ ∧ a = controlPayoff P f m v}
def variationalValue (P : Measure BrownianPath) (α β : ℝ) (φ : ℝ →ᵇ ℝ) : EReal := ⨅ m : Trial, ((α * controlValue P (β • φ) m : ℝ) : EReal) + (entropy m).toEReal
theorem main (P : Measure BrownianPath) [IsProbabilityMeasure P] (hB : IsBrownianReal brownianEval P) (α β : ℝ) (hα : 0 < α) (hβ : 0 < β) (φ : ℝ →ᵇ ℝ) : ∃ p : ℝ, variationalValue P α β φ = (p : EReal) ∧ Tendsto (fun N : ℕ => expectedPressure α β φ (N + 1)) atTop (𝓝 p) ∧ ∀ ε : ℝ, 0 < ε → Tendsto (fun N : ℕ => patternLaw α (N + 1) {g | ε < |pressure α β φ (N + 1) g - p|}) atTop (𝓝 0) := by sorry
end SphericalPerceptronFreeEnergy
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PerfectCompleteness", "solution_module": "OAI.Computability.PerfectCompleteness.Main", "theorem_names": [ "OAI.PerfectCompleteness.Theorem11.exists_reduction" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185import Mathlib
namespace OAI
namespace UniqueGamesTheorem.Foundations.Complexity
def encodeWord (n : Nat) : List Bool := List.replicate n true ++ [false]
def encodeWords : List Nat → List Bool | [] => [] | n :: ns => encodeWord n ++ encodeWords ns
end UniqueGamesTheorem.Foundations.Complexity
namespace UniqueGamesTheorem.Foundations.Complexity.MachineFiniteAlphabet
open Turing
def FiniteAlphabet (M : FinTM2) : Prop := ∀ k, Finite (M.Γ k)
end UniqueGamesTheorem.Foundations.Complexity.MachineFiniteAlphabet
namespace PerfectCompleteness.BinaryFormula
structure Literal where name : Nat positive : Bool deriving DecidableEq
def Literal.eval (literal : Literal) (assignment : Nat → Bool) : Bool := if literal.positive then assignment literal.name else !(assignment literal.name)
abbrev Clause := Vector Literal 3
def Clause.eval (clause : Clause) (assignment : Nat → Bool) : Bool := (clause[0].eval assignment || clause[1].eval assignment) || clause[2].eval assignment
structure Formula where clauses : List Clause
def Formula.Satisfiable (F : Formula) : Prop := ∃ assignment : Nat → Bool, ∀ clause ∈ F.clauses, clause.eval assignment = true
end PerfectCompleteness.BinaryFormula
namespace PerfectCompleteness.BinaryEncoding
open PerfectCompleteness.BinaryFormula
def bitsValue : List Bool → Nat | [] => 0 | b :: bits => Nat.bit b (bitsValue bits)
def parseFrame : List Bool → Option (List Bool × List Bool) | false :: rest => some ([], rest) | true :: b :: rest => do let (bits, trailing) ← parseFrame rest return (b :: bits, trailing) | _ => none
def parseName (input : List Bool) : Option (Nat × List Bool) := do let (digits, rest) ← parseFrame input let name := bitsValue digits if digits = name.bits then some (name, rest) else none
def parseLiteral : List Bool → Option (Literal × List Bool) | sign :: input => do let (name, rest) ← parseName input return (⟨name, sign⟩, rest) | [] => none
def parseClause (input : List Bool) : Option (Clause × List Bool) := do let (a, input) ← parseLiteral input let (b, input) ← parseLiteral input let (c, rest) ← parseLiteral input return (#v[a, b, c], rest)
def parseClauses : Nat → List Bool → Option (List Clause × List Bool) | 0, _ => none | _ + 1, false :: rest => some ([], rest) | fuel + 1, true :: input => do let (clause, input) ← parseClause input let (clauses, rest) ← parseClauses fuel input return (clause :: clauses, rest) | _ + 1, [] => none
def decodeFormula (input : List Bool) : Option Formula := do let (clauses, rest) ← parseClauses (input.length + 1) input if rest = [] then some ⟨clauses⟩ else none
end PerfectCompleteness.BinaryEncoding
namespace PerfectCompleteness.BinaryLanguage
def language (input : List Bool) : Prop := ∃ formula, BinaryEncoding.decodeFormula input = some formula ∧ formula.Satisfiable
end PerfectCompleteness.BinaryLanguage
namespace PerfectCompleteness
structure ProjectionTable (q : Nat) where images : Vector (Fin q) (2 * q) exactlyTwo : ∀ b : Fin q, ((List.finRange (2 * q)).filter (fun a => decide (images[a] = b))).length = 2
structure Edge (leftVertices rightVertices q : Nat) where left : Fin leftVertices right : Fin rightVertices projection : ProjectionTable q
structure Instance (q : Nat) where leftVertices : Nat rightVertices : Nat edges : List (Edge leftVertices rightVertices q) nonempty : edges ≠ []
abbrev Labeling {q : Nat} (G : Instance q) := (Fin G.leftVertices → Fin (2 * q)) × (Fin G.rightVertices → Fin q)
def Edge.satisfied {l r q : Nat} (e : Edge l r q) (a : Fin l → Fin (2 * q)) (b : Fin r → Fin q) : Bool := decide (e.projection.images[a e.left] = b e.right)
def countSatisfied {l r q : Nat} (a : Fin l → Fin (2 * q)) (b : Fin r → Fin q) : List (Edge l r q) → Nat | [] => 0 | e :: es => (if e.satisfied a b then 1 else 0) + countSatisfied a b es
end PerfectCompleteness
namespace PerfectCompleteness.Instance
def maxSatisfied {q : Nat} (G : Instance q) : Nat := Finset.univ.sup (fun s : Labeling G => countSatisfied s.1 s.2 G.edges)
noncomputable def value {q : Nat} (G : Instance q) : ℝ := (G.maxSatisfied : ℝ) / G.edges.length
end PerfectCompleteness.Instance
namespace PerfectCompleteness.Encoding
open UniqueGamesTheorem.Foundations.Complexity
def tableWords {q : Nat} (table : ProjectionTable q) : List Nat := table.images.toList.map Fin.val
def edgeWords {l r q : Nat} (edge : Edge l r q) : List Nat := [edge.left.val, edge.right.val] ++ tableWords edge.projection
def gameWords {q : Nat} (game : Instance q) : List Nat := [game.leftVertices, game.rightVertices, q, game.edges.length] ++ game.edges.flatMap edgeWords
def gameBits {q : Nat} (game : Instance q) : List Bool := encodeWords (gameWords game)
end PerfectCompleteness.Encoding
namespace PerfectCompleteness
open Turing UniqueGamesTheorem.Foundations.Complexity
structure BinaryGapReduction (δ : ℚ) where alphabet : Nat alphabet_ge_two : 2 ≤ alphabet construct : List Bool → Instance alphabet computation : TM2ComputableInPolyTime (id : List Bool → List Bool) Encoding.gameBits construct finiteAlphabet : MachineFiniteAlphabet.FiniteAlphabet computation.tm completeness : ∀ input, BinaryLanguage.language input → (construct input).value = 1 soundness : ∀ input, ¬BinaryLanguage.language input → (construct input).value ≤ (δ : ℝ)
end PerfectCompleteness
namespace PerfectCompleteness.Theorem11
theorem exists_reduction (δ : ℚ) (positive : 0 < δ) (less_than_one : δ < 1) : Nonempty (PerfectCompleteness.BinaryGapReduction δ) := by sorry
end PerfectCompleteness.Theorem11
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PeriodicGroup", "solution_module": "OAI.GroupTheory.PeriodicGroups.Main", "theorem_names": [ "OAI.SourceBurnside.thm_main" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import Mathlib
namespace OAI
universe u
namespace SourceBurnside
structure Root (n : ℕ) where row : Fin n col : Fin n ne : row ≠ col deriving DecidableEq
abbrev Generator (n : ℕ) (R : Type u) := Root n × R
def bracket {G : Type u} [Group G] (x y : G) : G := x * y * x⁻¹ * y⁻¹
def letter {n : ℕ} {R : Type u} (p : Root n) (a : R) : FreeGroup (Generator n R) := FreeGroup.of (p, a)
inductive SteinbergRel (n : ℕ) (R : Type u) [Ring R] : FreeGroup (Generator n R) → Prop | add (p : Root n) (a b : R) : SteinbergRel n R (letter p (a + b) * (letter p a * letter p b)⁻¹) | commute (p q : Root n) (h₁ : p.col ≠ q.row) (h₂ : p.row ≠ q.col) (a b : R) : SteinbergRel n R (bracket (letter p a) (letter q b)) | mul (i j k : Fin n) (hij : i ≠ j) (hjk : j ≠ k) (hik : i ≠ k) (a b : R) : SteinbergRel n R (bracket (letter ⟨i, j, hij⟩ a) (letter ⟨j, k, hjk⟩ b) * (letter ⟨i, k, hik⟩ (a * b))⁻¹)
def Steinberg (n : ℕ) (R : Type u) [Ring R] := PresentedGroup {r | SteinbergRel n R r} deriving Group
def Periodic (G : Type u) [Group G] : Prop := ∀ g : G, ∃ m : ℕ, 0 < m ∧ g ^ m = 1
def MainStatement : Prop := ∃ (R : Type) (_ : Ring R) (_ : Algebra (ZMod 2) R), Infinite (Steinberg 12 R) ∧ Group.IsFinitelyPresented (Steinberg 12 R) ∧ Periodic (Steinberg 12 R)
def BurnsideStatement : Prop := ∃ (G : Type) (_ : Group G), Infinite G ∧ Group.IsFinitelyPresented G ∧ Periodic G
end SourceBurnside
namespace SourceBurnside
theorem thm_main : MainStatement ∧ BurnsideStatement := by sorry
end SourceBurnside
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PeriodicTilingThree", "solution_module": "OAI.Geometry.PeriodicTiling.Main", "theorem_names": [ "OAI.PeriodicTilingThree.periodic_tiling_counterexample_and_minimality" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566import Mathlib
namespace OAI
noncomputable section
universe u
namespace PeriodicTilingThree
abbrev Lattice (d : ℕ) := Fin d → ℤ
variable {G : Type u} [AddCommGroup G]
def Tiles (F : Finset G) (A : Set G) : Prop := Function.Bijective (fun p : ↥F × A => (p.1 : G) + (p.2 : G))
def Period (A : Set G) (v : G) : Prop := ∀ x : G, x + v ∈ A ↔ x ∈ A
def FullyPeriodic (A : Set G) : Prop := ∃ P : AddSubgroup G, P.FiniteIndex ∧ ∀ v ∈ P, Period A v
open MeasureTheory
abbrev Space (d : ℕ) := Fin d → ℝ
def castLattice {d : ℕ} : Lattice d →+ Space d where toFun z i := (z i : ℝ) map_zero' := by ext i; simp map_add' z w := by ext i; simp
def unitCube (d : ℕ) : Set (Space d) := Set.Icc 0 1
def Thickening {d : ℕ} (F : Finset (Lattice d)) : Set (Space d) := {x | ∃ z ∈ F, x - castLattice z ∈ unitCube d}
def AETiles {d : ℕ} (Ω A : Set (Space d)) : Prop := ∀ᵐ x ∂volume, ∃! a : A, x - (a : Space d) ∈ Ω
def latticeOfBasis {d : ℕ} (b : Module.Basis (Fin d) ℝ (Space d)) : AddSubgroup (Space d) := (Submodule.span ℤ (Set.range b)).toAddSubgroup
def EuclideanFullyPeriodic {d : ℕ} (A : Set (Space d)) : Prop := ∃ b : Module.Basis (Fin d) ℝ (Space d), ∀ v ∈ latticeOfBasis b, Period A v
def HasTileWithoutPeriodicComplement (d : ℕ) : Prop := ∃ T : Finset (Lattice d), T.Nonempty ∧ (∃ A : Set (Lattice d), Tiles T A) ∧ ∀ A : Set (Lattice d), Tiles T A → ¬ FullyPeriodic A
theorem periodic_tiling_counterexample_and_minimality : (∃ T : Finset (Lattice 3), T.Nonempty ∧ (∃ A : Set (Lattice 3), Tiles T A) ∧ (∀ A : Set (Lattice 3), Tiles T A → ¬ FullyPeriodic A) ∧ (∃ A : Set (Space 3), AETiles (Thickening T) A) ∧ (∀ A : Set (Space 3), AETiles (Thickening T) A → ¬ EuclideanFullyPeriodic A)) ∧ IsLeast {d : ℕ | HasTileWithoutPeriodicComplement d} 3 := by sorry
end PeriodicTilingThree
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PermanentCubic", "solution_module": "OAI.Algebra.Determinantal.Main", "theorem_names": [ "OAI.PermanentBorder.permanent_cubic_lower_bounds" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142import Mathlib
namespace OAI
namespace PermanentBorder
open Filteropen scoped Topology
abbrev Variables (m : ℕ) := Fin m × Fin mabbrev Poly (σ : Type*) := MvPolynomial σ ℂ
noncomputable def permanentPolynomial (m : ℕ) : Poly (Variables m) := ∑ τ : Equiv.Perm (Fin m), ∏ i : Fin m, MvPolynomial.X (i, τ i)
noncomputable def affineMatrixPolynomial {σ : Type*} [Fintype σ] (n : ℕ) (A₀ : Matrix (Fin n) (Fin n) ℂ) (A : σ → Matrix (Fin n) (Fin n) ℂ) : Poly σ := Matrix.det (fun i j => MvPolynomial.C (A₀ i j) + ∑ v : σ, MvPolynomial.C (A v i j) * MvPolynomial.X v)
def HasBorderDeterminant {σ : Type*} [Fintype σ] (n : ℕ) (p : Poly σ) : Prop := 0 < n ∧ ∃ (A₀ : ℕ → Matrix (Fin n) (Fin n) ℂ) (A : ℕ → σ → Matrix (Fin n) (Fin n) ℂ), ∀ d : σ →₀ ℕ, Tendsto (fun j => (affineMatrixPolynomial n (A₀ j) (A j)).coeff d) atTop (𝓝 (p.coeff d))
def HasExactDeterminant {σ : Type*} [Fintype σ] (n : ℕ) (p : Poly σ) : Prop := 0 < n ∧ ∃ (A₀ : Matrix (Fin n) (Fin n) ℂ) (A : σ → Matrix (Fin n) (Fin n) ℂ), affineMatrixPolynomial n A₀ A = p
theorem permanent_cubic_lower_bounds : (∀ (m n : ℕ), 1408 ≤ m → HasBorderDeterminant n (permanentPolynomial m) → (m : ℝ)^3 / (5529600 * Real.exp 1) ≤ (n : ℝ)) ∧ (∀ (m n : ℕ), 1408 ≤ m → HasExactDeterminant n (permanentPolynomial m) → (m : ℝ)^3 / (5529600 * Real.exp 1) ≤ (n : ℝ)) := by sorry
end PermanentBorder
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PettyProjectionVolume", "solution_module": "OAI.Geometry.ProjectionBodies.Main", "theorem_names": [ "OAI.PettyProjection.petty_projection_volume" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354import Mathlib
namespace OAI
noncomputable sectionopen Set MeasureTheoryopen scoped RealInnerProductSpace
namespace PettyProjection
abbrev Space (n : ℕ) := EuclideanSpace ℝ (Fin n)
def IsConvexBody {n : ℕ} (K : Set (Space n)) : Prop := IsCompact K ∧ Convex ℝ K ∧ (interior K).Nonempty
def unitBall (n : ℕ) : Set (Space n) := Metric.closedBall 0 1
def kappa (n : ℕ) : ℝ := volume.real (unitBall n)
def perpendicular {n : ℕ} (u : Space n) : Submodule ℝ (Space n) := (Submodule.span ℝ {u})ᗮ
/-- Volume in the induced Euclidean structure on the orthogonal hyperplane. -/def shadowVolume {n : ℕ} (K : Set (Space n)) (u : Space n) : ℝ := (volume : Measure (perpendicular u)).real ((perpendicular u).orthogonalProjectionOnto '' K)
/-- The body with support function equal to the volumes of orthogonal shadows,expressed as its defining intersection of supporting half-spaces. -/def projectionBody {n : ℕ} (K : Set (Space n)) : Set (Space n) := {x | ∀ u : Space n, ‖u‖ = 1 → ⟪u, x⟫ ≤ shadowVolume K u}
def projectionRatio {n : ℕ} (K : Set (Space n)) : ℝ := volume.real (projectionBody K) / volume.real K ^ (n - 1)
def pettyConstant (n : ℕ) : ℝ := kappa (n - 1) ^ n * kappa n ^ (2 - (n : ℤ))
def IsEllipsoid {n : ℕ} (K : Set (Space n)) : Prop := ∃ (a : Space n) (T : Space n ≃ₗ[ℝ] Space n), K = (fun x => a + T x) '' unitBall n
/-- The exact unrestricted inequality and its global equality characterization.-/theorem petty_projection_volume (n : ℕ) (hn : 4 ≤ n) (K : Set (Space n)) (hK : IsConvexBody K) : pettyConstant n ≤ projectionRatio K ∧ (projectionRatio K = pettyConstant n ↔ IsEllipsoid K) := by sorry
end PettyProjectionend
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PiExponent", "solution_module": "OAI.NumberTheory.PiExponent.Main", "theorem_names": [ "OAI.PiExponent.main" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}12345678910111213141516171819import Mathlib
namespace OAI
namespace PiExponent
theorem main : (∀ ν : ℝ, 2 < ν → ∃ Q : ℤ, 2 ≤ Q ∧ ∀ p q : ℤ, Q ≤ q → (q : ℝ) ^ (-ν) ≤ |Real.pi - (p : ℝ) / (q : ℝ)|) ∧ sSup {ν : ℝ | 0 < ν ∧ Set.Infinite {r : ℚ | 2 ≤ r.den ∧ 0 < |Real.pi - (r : ℝ)| ∧ |Real.pi - (r : ℝ)| < (r.den : ℝ) ^ (-ν)}} = 2 := by sorry
end PiExponent
end OAI12345678910111213141516{ "challenge_module": "ComparatorChallenges.PinchedKahler", "solution_module": "OAI.Geometry.Kahler.Main", "theorem_names": [ "OAI.PinchedHartogs.main_theorem", "OAI.PinchedHartogs.controlled_potential", "OAI.PinchedHartogs.metric_transfer" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159import Mathlib
namespace OAI
noncomputable section
open Set Filter Topologyopen scoped ContDiff
namespace PinchedHartogs
abbrev Base := EuclideanSpace ℂ (Fin 2)abbrev Ambient := Base × ℂabbrev Target := Fin 3 → ℂ
def ball : Set Base := {z | ‖z‖ < 1}
def hartogs (φ : Base → ℝ) : Set Ambient := {p | p.1 ∈ ball ∧ Real.exp (φ p.1) * ‖p.2‖ ^ 2 < 1}
def noMinorant (φ : Base → ℝ) : Prop := ¬ ∃ (H : Base → ℂ) (C : ℝ), AnalyticOnNhd ℂ H ball ∧ ∀ z ∈ ball, (H z).re ≤ C + 4 * Real.log (1 / (1 - ‖z‖)) + φ z
def coordVector (j : Fin 3) : Ambient := ![(EuclideanSpace.single 0 1, 0), (EuclideanSpace.single 1 1, 0), (0, 1)] j
def jacobian (F : Ambient → Target) (p : Ambient) : Matrix (Fin 3) (Fin 3) ℂ := fun i j ↦ (fderiv ℂ F p (coordVector j)) i
open scoped Matrix.Norms.Elementwise
abbrev CMatrix := Matrix (Fin 3) (Fin 3) ℂabbrev CurvatureTensor := Fin 3 → Fin 3 → Fin 3 → Fin 3 → ℂ
def coordinates (u : Ambient) : Fin 3 → ℂ := ![u.1 0, u.1 1, u.2]
def dz (f : Ambient → ℂ) (p : Ambient) (j : Fin 3) : ℂ := (fderiv ℝ f p (coordVector j) - Complex.I * fderiv ℝ f p (Complex.I • coordVector j)) / 2
def dbar (f : Ambient → ℂ) (p : Ambient) (j : Fin 3) : ℂ := (fderiv ℝ f p (coordVector j) + Complex.I * fderiv ℝ f p (Complex.I • coordVector j)) / 2
def hermitianValue (h : CMatrix) (u v : Ambient) : ℂ := ∑ i, ∑ j, h i j * coordinates u i * star (coordinates v j)
def realArea (h : CMatrix) (u v : Ambient) : ℝ := (hermitianValue h u u).re * (hermitianValue h v v).re - (hermitianValue h u v).re ^ 2
def tensorValue (R : CurvatureTensor) (u v w y : Ambient) : ℂ := ∑ a, ∑ b, ∑ c, ∑ d, R a b c d * coordinates u a * star (coordinates v b) * coordinates w c * star (coordinates y d)
def curvature (g : Ambient → CMatrix) (p : Ambient) : CurvatureTensor := fun a b c d ↦ -dbar (fun q ↦ dz (fun r ↦ g r c d) q a) p b + ∑ e, ∑ k, (g p)⁻¹ e k * dz (fun q ↦ g q c e) p a * dbar (fun q ↦ g q k d) p b
def sectional (g : Ambient → CMatrix) (p u v : Ambient) : ℝ := ((tensorValue (curvature g p) u u v v).re - (tensorValue (curvature g p) u v u v).re) / (2 * realArea (g p) u v)
def IsKahlerMetric (M : Set Ambient) (g : Ambient → CMatrix) : Prop := ContDiffOn ℝ ∞ g M ∧ (∀ p ∈ M, ∀ i j, g p i j = star (g p j i)) ∧ (∀ p ∈ M, ∀ u : Ambient, u ≠ 0 → 0 < (hermitianValue (g p) u u).re) ∧ (∀ p ∈ M, ∀ i j k, dz (fun q ↦ g q k j) p i = dz (fun q ↦ g q i j) p k)
def christoffel (g : Ambient → CMatrix) (p : Ambient) (k a c : Fin 3) : ℂ := ∑ e, (g p)⁻¹ e k * dz (fun q ↦ g q c e) p a
def GeodesicallyComplete (M : Set Ambient) (g : Ambient → CMatrix) : Prop := ∀ p ∈ M, ∀ v : Ambient, ∃ γ : ℝ → Ambient, ContDiff ℝ ∞ γ ∧ (∀ t, γ t ∈ M) ∧ γ 0 = p ∧ deriv γ 0 = v ∧ ∀ t k, coordinates (deriv (deriv γ) t) k + ∑ a, ∑ c, christoffel g (γ t) k a c * coordinates (deriv γ t) a * coordinates (deriv γ t) c = 0
def IsNegativelyPinched (M : Set Ambient) (g : Ambient → CMatrix) (A B : ℝ) : Prop := 0 < A ∧ A ≤ B ∧ ∀ p ∈ M, ∀ u v : Ambient, LinearIndependent ℝ ![u, v] → -B ≤ sectional g p u v ∧ sectional g p u v ≤ -A
def NoBoundedCoordinates (M : Set Ambient) : Prop := ∀ F : Ambient → Target, AnalyticOnNhd ℂ F M → (∃ B : ℝ, ∀ p ∈ M, ∀ i, ‖F p i‖ ≤ B) → ¬ ∀ p ∈ M, (jacobian F p).det ≠ 0
def BiholomorphicToBoundedDomain (M : Set Ambient) : Prop := ∃ N : Set Ambient, IsOpen N ∧ Bornology.IsBounded N ∧ ∃ F G : Ambient → Ambient, AnalyticOnNhd ℂ F M ∧ AnalyticOnNhd ℂ G N ∧ MapsTo F M N ∧ MapsTo G N M ∧ (∀ p ∈ M, G (F p) = p) ∧ (∀ q ∈ N, F (G q) = q)
def MainTheorem : Prop := ∃ (M : Set Ambient) (g : Ambient → CMatrix) (A B : ℝ), IsOpen M ∧ M.Nonempty ∧ ContractibleSpace M ∧ IsKahlerMetric M g ∧ GeodesicallyComplete M g ∧ IsNegativelyPinched M g A B ∧ NoBoundedCoordinates M ∧ ¬ BiholomorphicToBoundedDomain M
def psi (z : Base) : ℝ := -Real.log (1 - ‖z‖ ^ 2)def metricPotential (φ : Base → ℝ) (lam : ℝ) (p : Ambient) : ℝ := lam * psi p.1 - Real.log (1 - Real.exp (φ p.1) * ‖p.2‖ ^ 2)
def complexHessian (f : Ambient → ℝ) (p : Ambient) : CMatrix := fun i j ↦ dz (fun q ↦ dbar (fun r ↦ (f r : ℂ)) q j) p i
def hartogsMetric (φ : Base → ℝ) (lam : ℝ) : Ambient → CMatrix := complexHessian (metricPotential φ lam)
def dzBase (f : Base → ℂ) (z : Base) (i : Fin 2) : ℂ := (fderiv ℝ f z (EuclideanSpace.single i 1) - Complex.I * fderiv ℝ f z (Complex.I • EuclideanSpace.single i 1)) / 2
def dbarBase (f : Base → ℂ) (z : Base) (i : Fin 2) : ℂ := (fderiv ℝ f z (EuclideanSpace.single i 1) + Complex.I * fderiv ℝ f z (Complex.I • EuclideanSpace.single i 1)) / 2
def baseHessian (φ : Base → ℝ) (z : Base) : Matrix (Fin 2) (Fin 2) ℂ := fun i j ↦ dzBase (fun q ↦ dbarBase (fun r ↦ (φ r : ℂ)) q j) z i
def centeredChart (r : ℝ) (U : Base ≃ₗᵢ[ℂ] Base) (ζ : Base) : Base := U (WithLp.toLp 2 ![((r : ℂ) + ζ 0) / (1 + (r : ℂ) * ζ 0), ((Real.sqrt (1 - r ^ 2) : ℝ) : ℂ) * ζ 1 / (1 + (r : ℂ) * ζ 0)])
def ChartControl (φ : Base → ℝ) (c C : ℝ) : Prop := ∀ r : ℝ, 0 ≤ r → r < 1 → ∀ U : Base ≃ₗᵢ[ℂ] Base, ∀ v : Base, c * ‖v‖ ^ 2 ≤ (∑ i, ∑ j, baseHessian (φ ∘ centeredChart r U) 0 i j * v i * star (v j)).re ∧ (∑ i, ∑ j, baseHessian (φ ∘ centeredChart r U) 0 i j * v i * star (v j)).re ≤ C * ‖v‖ ^ 2
def ChartJets (φ : Base → ℝ) (C : ℝ) : Prop := ∀ r : ℝ, 0 ≤ r → r < 1 → ∀ U : Base ≃ₗᵢ[ℂ] Base, ∀ i j k l : Fin 2, ‖dzBase (fun z ↦ baseHessian (φ ∘ centeredChart r U) z i j) 0 k‖ + ‖dbarBase (fun z ↦ baseHessian (φ ∘ centeredChart r U) z i j) 0 l‖ + ‖dzBase (fun z ↦ dbarBase (fun q ↦ baseHessian (φ ∘ centeredChart r U) q i j) z l) 0 k‖ ≤ C
def ControlledPotential : Prop := ∃ φ : Base → ℝ, ∃ C : ℝ, ContDiffOn ℝ ∞ φ ball ∧ ChartControl φ 1 C ∧ ChartJets φ C ∧ noMinorant φ
def MetricTransfer : Prop := ∀ c C : ℝ, 0 < c → c ≤ C → ∃ lam0 : ℝ, 0 < lam0 ∧ ∀ φ : Base → ℝ, ContDiffOn ℝ ∞ φ ball → ChartControl φ c C → ChartJets φ C → ∀ lam : ℝ, lam0 ≤ lam → ContractibleSpace (hartogs φ) ∧ IsKahlerMetric (hartogs φ) (hartogsMetric φ lam) ∧ GeodesicallyComplete (hartogs φ) (hartogsMetric φ lam) ∧ ∃ A B : ℝ, IsNegativelyPinched (hartogs φ) (hartogsMetric φ lam) A B
theorem main_theorem : MainTheorem := by sorry
theorem controlled_potential : ControlledPotential := by sorry
theorem metric_transfer : MetricTransfer := by sorry
end PinchedHartogs
end
end OAI12345678910111213{ "challenge_module": "ComparatorChallenges.PinnedDistances", "solution_module": "OAI.Geometry.PinnedDistances.Main", "theorem_names": [ "OAI.WeakPinned.main" ], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536import Mathlib
namespace OAI
noncomputable sectionopen Filteropen scoped Topology
namespace WeakPinnedabbrev Plane := EuclideanSpace ℝ (Fin 2)
def distanceFiber (P : Finset Plane) (x y : Plane) : Finset Plane := (P.erase x).filter (fun z => dist z x = dist y x)
def k (P : Finset Plane) (x y : Plane) : ℕ := (distanceFiber P x y).card
def richPairs (P : Finset Plane) (s : ℝ) : Finset (Plane × Plane) := (P ×ˢ P).filter (fun xy => xy.1 ≠ xy.2 ∧ (P.card : ℝ) ^ s ≤ (k P xy.1 xy.2 : ℝ))
def pairFraction (P : Finset Plane) (s : ℝ) : ℝ := (richPairs P s).card / ((P.card : ℝ) * ((P.card : ℝ) - 1))
def F (n : ℕ) (s : ℝ) : ℝ := if 2 ≤ n then sSup {a : ℝ | ∃ P : Finset Plane, P.card = n ∧ a = pairFraction P s} else 0
theorem main (s : ℝ) (hs : 0<s) : Tendsto (fun n : ℕ => F n s) atTop (𝓝 0) := by sorry
end WeakPinned
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlanarAndersonSpectrum", "definition_names": [], "enable_nanoda": false, "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "solution_module": "OAI.MathematicalPhysics.PlanarAnderson.Spectrum", "theorem_names": [ "OAI.PlanarAnderson.anderson_spectrum_ae" ]}1234567891011121314151617181920212223242526272829303132333435import Mathlib
namespace OAI
noncomputable sectionopen MeasureTheoryopen scoped ENNReal
namespace PlanarAnderson
abbrev Site := ℤ × ℤabbrev Configuration := Site → ℝabbrev Hilbert := lp (fun _ : Site => ℂ) 2
def disorderLaw (h : ℝ) : Measure Configuration := Measure.infinitePi (fun _ : Site => ProbabilityTheory.cond volume (Set.Icc (-h) h))
def IsAndersonOperator (v : Configuration) (H : Hilbert →L[ℂ] Hilbert) : Prop := ∀ (u : Hilbert) (x : Site), (H u) x = u (x.1 + 1, x.2) + u (x.1 - 1, x.2) + u (x.1, x.2 + 1) + u (x.1, x.2 - 1) + (v x : ℂ) * u x
def spectralInterval (h : ℝ) : Set ℂ := {z | z.im = 0 ∧ -4 - h ≤ z.re ∧ z.re ≤ 4 + h}
theorem anderson_spectrum_ae {h : ℝ} (hh : 0 < h) : ∀ᵐ v ∂disorderLaw h, ∃ H : Hilbert →L[ℂ] Hilbert, IsAndersonOperator v H ∧ IsSelfAdjoint H ∧ spectrum ℂ H = spectralInterval h := by sorry
end PlanarAnderson
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlanarFalconer", "solution_module": "OAI.MeasureTheory.Falconer.Main", "theorem_names": [ "OAI.PlanarFalconer.mainTarget_proved" ], "definition_names": [], "permitted_axioms": [ "propext", "Classical.choice", "Quot.sound" ], "enable_nanoda": false}12345678910111213141516171819202122232425import Mathlib
namespace OAI
namespace PlanarFalconeropen MeasureTheory Set
abbrev Plane := EuclideanSpace ℝ (Fin 2)
def distanceSet (E : Set Plane) : Set ℝ := {r | ∃ x ∈ E, ∃ y ∈ E, dist x y = r}
def MainTarget : Prop := ∀ E : Set Plane, IsCompact E → 1 < dimH E → 0 < volume (distanceSet E)
end PlanarFalconer
namespace PlanarFalconer
theorem mainTarget_proved : MainTarget := by sorry
end PlanarFalconer
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlanarFirstPassage", "solution_module": "OAI.Probability.FirstPassage.BoundaryCurve", "theorem_names": [ "OAI.PlanarFPP.manuscriptMain" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102import Mathlib.Algebra.BigOperators.Group.List.Basicimport Mathlib.Algebra.Group.Prodimport Mathlib.Analysis.Calculus.ContDiff.Defsimport Mathlib.Analysis.Calculus.Deriv.Basicimport Mathlib.Analysis.Calculus.FDeriv.Basicimport Mathlib.Analysis.InnerProductSpace.PiL2import Mathlib.Analysis.LocallyConvex.WithSeminormsimport Mathlib.Probability.Distributions.Exponentialimport Mathlib.Probability.Independence.Basic
namespace OAI
namespace PlanarFPP
open Set MeasureTheory ProbabilityTheory Filteropen scoped Topology
abbrev Vertex := ℤ × ℤ
abbrev Edge := Vertex × Bool
inductive Step where | east | west | north | south deriving DecidableEq
def Step.delta : Step → Vertex | .east => (1, 0) | .west => (-1, 0) | .north => (0, 1) | .south => (0, -1)
def Step.edge (p : Vertex) : Step → Edge | .east => (p, false) | .west => (p + (-1, 0), false) | .north => (p, true) | .south => (p + (0, -1), true)
def displacement (ds : List Step) : Vertex := (ds.map Step.delta).sum
def pathCost (τ : Edge → ℝ) (p : Vertex) : List Step → ℝ | [] => 0 | d :: ds => τ (d.edge p) + pathCost τ (p + d.delta) ds
abbrev Plane := EuclideanSpace ℝ (Fin 2)
noncomputable def latticeFloor (v : Plane) : Vertex := (⌊v 0⌋, ⌊v 1⌋)
noncomputable def passageTime (τ : Edge → ℝ) (p q : Vertex) : ℝ := sInf {t | ∃ ds : List Step, p + displacement ds = q ∧ pathCost τ p ds = t}
structure TimeConstantNorm (μ : Plane → ℝ) : Prop where nonneg : ∀ v, 0 ≤ μ v zero_iff : ∀ v, μ v = 0 ↔ v = 0 triangle : ∀ v w, μ (v + w) ≤ μ v + μ w homogeneous : ∀ (a : ℝ) v, μ (a • v) = |a| * μ v
structure ExponentialEnvironment {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (τ : Edge → Ω → ℝ) : Prop where probability : IsProbabilityMeasure P measurable : ∀ e, Measurable (τ e) independent : iIndepFun τ P marginal : ∀ e, Measure.map (τ e) P = expMeasure 1
def IsTimeConstant {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (τ : Edge → Ω → ℝ) (μ : Plane → ℝ) : Prop := ∀ v : Plane, ∀ᵐ ω ∂P, Tendsto (fun t : ℝ => passageTime (fun e => τ e ω) (0, 0) (latticeFloor (t • v)) / t) atTop (𝓝 (μ v))
def DifferentiableAwayFromOrigin (μ : Plane → ℝ) : Prop := ∀ v : Plane, v ≠ 0 → ∃ ℓ : Plane →L[ℝ] ℝ, HasFDerivAt μ ℓ v
def UniqueNormalizedSupports (μ : Plane → ℝ) : Prop := ∀ v : Plane, μ v = 1 → ∃! ℓ : Plane →L[ℝ] ℝ, ℓ v = 1 ∧ ∀ w, ℓ w ≤ μ w
def C1UnitSphere (μ : Plane → ℝ) : Prop := ∀ v : Plane, μ v = 1 → ∃ U : Set Plane, IsOpen U ∧ v ∈ U ∧ ∃ g : Plane → ℝ, ContDiffOn ℝ 1 g U ∧ (∀ w ∈ U, μ w = 1 ↔ g w = 0) ∧ ∀ w ∈ U, g w = 0 → ∃ ℓ : Plane →L[ℝ] ℝ, HasFDerivAt g ℓ w ∧ ℓ ≠ 0
def HasC1CurveChart (S : Set Plane) (v : Plane) : Prop := ∃ U : Set Plane, IsOpen U ∧ v ∈ U ∧ v ∈ S ∧ ∃ γ : ℝ → Plane, ∃ θ : Plane → ℝ, ContDiff ℝ 1 γ ∧ ContinuousOn θ U ∧ (∀ t, γ t ∈ S ∩ U) ∧ (∀ t, θ (γ t)=t) ∧ (∀ z ∈ S ∩ U, γ (θ z)=z) ∧ (∀ t, ∃ d : Plane, HasDerivAt γ d t ∧ d ≠ 0)
theorem manuscriptMain (Ω : Type) [MeasurableSpace Ω] (P : Measure Ω) (τ : Edge → Ω → ℝ) (henv : ExponentialEnvironment P τ) : ∃ μ : Plane → ℝ, TimeConstantNorm μ ∧ IsTimeConstant P τ μ ∧ DifferentiableAwayFromOrigin μ ∧ UniqueNormalizedSupports μ ∧ C1UnitSphere μ ∧ (∀ v ∈ frontier {z | μ z ≤ 1}, ∃! L : Set Plane, ∃ g : Plane →L[ℝ] ℝ, g ≠ 0 ∧ (∀ z, μ z ≤ 1 → g z ≤ g v) ∧ L={z | g z=g v}) ∧ (∀ v ∈ frontier {z | μ z ≤ 1}, HasC1CurveChart (frontier {z | μ z ≤ 1}) v) := by sorry
end PlanarFPP
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlanarL1", "solution_module": "OAI.Combinatorics.PlanarL1.Embedding", "theorem_names": [ "OAI.PlanarL1.planar_graph_metrics_embed_L1" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import Mathlib
namespace OAI
namespace PlanarL1
/-- A topological drawing by simple plane arcs, with injective vertex placement,no vertex in an edge interior, and disjoint interiors for distinct unoriented edges. -/def IsPlanar {V : Type} (G : SimpleGraph V) : Prop := ∃ (point : V → ℝ × ℝ) (arc : ∀ u v : V, G.Adj u v → C(unitInterval, ℝ × ℝ)), Function.Injective point ∧ (∀ u v h, (arc u v h) 0 = point u ∧ (arc u v h) 1 = point v) ∧ (∀ u v h, Function.Injective (arc u v h)) ∧ (∀ u v h (t : unitInterval) w, 0 < (t : ℝ) → (t : ℝ) < 1 → (arc u v h) t ≠ point w) ∧ (∀ u v h x y k (s t : unitInterval), 0 < (s : ℝ) → (s : ℝ) < 1 → 0 < (t : ℝ) → (t : ℝ) < 1 → (arc u v h) s = (arc x y k) t → (u = x ∧ v = y) ∨ (u = y ∧ v = x))
/-- The sum of edge lengths along a finite graph walk. -/def walkLength {V : Type} {G : SimpleGraph V} (length : V → V → ℝ) {u v : V} : G.Walk u v → ℝ | .nil => 0 | @SimpleGraph.Walk.cons _ _ u w _ _ p => length u w + walkLength length p
/-- The infimum of lengths of actual walks between the two vertices. -/noncomputable def graphDistance {V : Type} (G : SimpleGraph V) (length : V → V → ℝ) (u v : V) : ℝ := sInf (Set.range (fun p : G.Walk u v => walkLength length p))
/-- One universal distortion bound for finite connected planar graphs witharbitrary symmetric positive edge lengths, realized in a real `L¹` space. -/def MainStatement : Prop := ∃ C : ℝ, 1 ≤ C ∧ ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (length : Fin n → Fin n → ℝ), G.Connected → IsPlanar G → (∀ u v, length u v = length v u) → (∀ u v, G.Adj u v → 0 < length u v) → ∃ (Ω : Type) (measurable : MeasurableSpace Ω) (μ : @MeasureTheory.Measure Ω measurable) (f : Fin n → @MeasureTheory.Lp Ω ℝ measurable _ 1 μ), ∀ x y, graphDistance G length x y ≤ ‖f x - f y‖ ∧ ‖f x - f y‖ ≤ C * graphDistance G length x y
theorem planar_graph_metrics_embed_L1 : MainStatement := by sorry
end PlanarL1
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlanarPacking", "solution_module": "OAI.Analysis.PlanarPacking.Main", "theorem_names": [ "OAI.sharp_fourier_certificate" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}12345678910111213141516171819202122232425262728293031323334353637383940import Mathlib
namespace OAI
/-!# A sharp Fourier certificate for planar circle packing
The normalization and Fourier convention are those of*A sharp Fourier certificate for planar circle packing* (OpenAI, 2026).-/
open MeasureTheory
namespace SharpPlanar
abbrev Plane := EuclideanSpace ℝ (Fin 2)
/-- Radiality of a real function on the Euclidean plane. -/def Radial (f : Plane → ℝ) : Prop := ∀ x y, ‖x‖ = ‖y‖ → f x = f y
/-- Fourier transformation with kernel `exp (-2πi⟪x, ξ⟫)`. -/noncomputable def fourier (f : Plane → ℝ) (ξ : Plane) : ℂ := ∫ x : Plane, (f x : ℂ) * Complex.exp (((-2 * Real.pi * inner ℝ x ξ : ℝ) : ℂ) * Complex.I)
/-- A normalized sharp certificate for disks of radius one half. -/def SharpCertificate (f : SchwartzMap Plane ℝ) : Prop := Radial f ∧ fourier f 0 = 1 ∧ f 0 = 2 / Real.sqrt 3 ∧ (∀ ξ, (fourier f ξ).im = 0 ∧ 0 ≤ (fourier f ξ).re) ∧ (∀ x, 1 ≤ ‖x‖ → f x ≤ 0)
end SharpPlanar
/-- The sharp Fourier certificate theorem. -/theorem sharp_fourier_certificate : ∃ f : SchwartzMap SharpPlanar.Plane ℝ, SharpPlanar.SharpCertificate f := by sorry
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlanarUnitDistances", "solution_module": "OAI.Geometry.UnitDistances.Main", "theorem_names": [ "OAI.PlanarUnitDistances.main" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}12345678910111213141516171819202122232425import Mathlib
namespace OAI
namespace PlanarUnitDistances
abbrev Plane := EuclideanSpace ℝ (Fin 2)
def IsUnitPair : Sym2 Plane → Prop := Sym2.lift ⟨fun x y => dist x y = 1, fun x y => by dsimp; rw [dist_comm]⟩
noncomputable def unitPairCount (X : Finset Plane) : ℕ := by classical exact (X.sym2.filter IsUnitPair).card
noncomputable def u (n : ℕ) : ℕ := sSup {m : ℕ | ∃ X : Finset Plane, X.card = n ∧ unitPairCount X = m}
theorem main : ∃ C β : ℝ, 0 < C ∧ 1 ≤ β ∧ β < (4 : ℝ) / 3 ∧ ∀ n : ℕ, (u n : ℝ) ≤ C * (n : ℝ) ^ β := by sorry
end PlanarUnitDistances
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PlaneColoring", "solution_module": "OAI.Geometry.PlaneColoring.Main", "theorem_names": [ "OAI.Problem160.properColoring_seven" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021import Mathlib
namespace OAI
noncomputable section
namespace Problem160
abbrev Plane := EuclideanSpace ℝ (Fin 2)
def ProperColoring (k : ℕ) : Prop := ∃ c : Plane → Fin k, ∀ x y : Plane, dist x y = 1 → c x ≠ c y
theorem properColoring_seven : ProperColoring 7 := by sorry
end Problem160
end
end OAI12345678910111213141516{ "challenge_module": "ComparatorChallenges.PolycyclicRecognition", "solution_module": "OAI.GroupTheory.PolycyclicRecognition.Recognition", "theorem_names": [ "OAI.PolycyclicRecognition.group_recognition", "OAI.PolycyclicRecognition.main_uniform_bounded_height", "OAI.PolycyclicRecognition.lattice_recognition" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249import Mathlib
namespace OAI
/-! # Quasi-isometric recognition and uniform bounded height
A polycyclic group has a finite subnormal series with cyclic factors. Theheight quotient below is the quotient of the Lie algebra by the commonkernel of the diagonal adjoint characters.-/
noncomputable section
namespace ChromaticCyclic
structure CyclicStep {G : Type*} [Group G] (H K : Subgroup G) : Prop where le : H ≤ K normal : (H.subgroupOf K).Normal cyclic : letI := normal; IsCyclic (K ⧸ H.subgroupOf K)
structure CyclicSeries {G : Type*} [Group G] (H K : Subgroup G) (n : ℕ) where group : ℕ → Subgroup G first : group 0 = H last : group n = K step : ∀ i < n, CyclicStep (group i) (group (i + 1))
end ChromaticCyclic
namespace PolycyclicRecognition
open Module LieAlgebra MeasureTheoryopen scoped Manifold NNReal
section Coarse
variable {G H J : Type*} [Group G] [Group H] [Group J]
/-- Uniform control of finite sets of group differences. -/def GroupBornologous (f : G → H) : Prop := ∀ S : Set G, S.Finite → ∃ T : Set H, T.Finite ∧ ∀ x y, x⁻¹ * y ∈ S → (f x)⁻¹ * f y ∈ T
/-- Coarse inverse maps with errors contained in fixed finite sets. -/structure GroupCoarseEquivalence (G H : Type*) [Group G] [Group H] where toFun : G → H invFun : H → G bornologous_toFun : GroupBornologous toFun bornologous_invFun : GroupBornologous invFun left_error : (Set.range fun x => x⁻¹ * invFun (toFun x)).Finite right_error : (Set.range fun y => y⁻¹ * toFun (invFun y)).Finite
end Coarse
section Polycyclic
open ChromaticCyclic
variable (G : Type*) [Group G]
/-- Polycyclicity expressed by an actual cyclic subnormal series. -/def IsPolycyclic : Prop := ∃ n : ℕ, Nonempty (CyclicSeries (⊥ : Subgroup G) ⊤ n)
/-- Virtual polycyclicity means a polycyclic subgroup of finite index. -/def IsVirtuallyPolycyclic : Prop := ∃ H : Subgroup G, H.FiniteIndex ∧ IsPolycyclic H
end Polycyclic
section UniformLattice
variable {G : Type*} [Group G]
/-- A uniform lattice is discrete and has a compact fundamental cover. -/def IsUniformLattice [TopologicalSpace G] (Λ : Subgroup G) : Prop := DiscreteTopology Λ ∧ ∃ K : Set G, IsCompact K ∧ ∀ g : G, ∃ (γ : Λ) (k : G), k ∈ K ∧ (γ : G) * k = g
end UniformLattice
/-- A connected simply connected finite-dimensional real solvable Lie group. -/structure SimplyConnectedSolvableLieModel where modelSpace : Type [normedAddCommGroup : NormedAddCommGroup modelSpace] [normedSpace : NormedSpace ℝ modelSpace] [finiteDimensional : FiniteDimensional ℝ modelSpace] carrier : Type [topologicalSpace : TopologicalSpace carrier] [chartedSpace : ChartedSpace modelSpace carrier] [group : Group carrier] [lieGroup : LieGroup (𝓘(ℝ, modelSpace)) ⊤ carrier] [t2Space : T2Space carrier] [secondCountableTopology : SecondCountableTopology carrier] [simplyConnectedSpace : SimplyConnectedSpace carrier] [solvable : Group.IsSolvable carrier]
attribute [instance] SimplyConnectedSolvableLieModel.normedAddCommGroup SimplyConnectedSolvableLieModel.normedSpace SimplyConnectedSolvableLieModel.finiteDimensional SimplyConnectedSolvableLieModel.topologicalSpace SimplyConnectedSolvableLieModel.chartedSpace SimplyConnectedSolvableLieModel.group SimplyConnectedSolvableLieModel.lieGroup SimplyConnectedSolvableLieModel.t2Space SimplyConnectedSolvableLieModel.simplyConnectedSpace SimplyConnectedSolvableLieModel.secondCountableTopology SimplyConnectedSolvableLieModel.solvable
/-- A discrete subgroup with a normalized invariant measure on its coset space. -/def IsFiniteCovolumeLattice {G : Type} [Group G] [TopologicalSpace G] (Λ : Subgroup G) : Prop := letI : MeasurableSpace (G ⧸ Λ) := borel _ DiscreteTopology Λ ∧ ∃ μ : Measure (G ⧸ Λ), IsProbabilityMeasure μ ∧ SMulInvariantMeasure G (G ⧸ Λ) μ
/-- Explicit chains with bounded steps and a linear bound on their length. -/structure LinearMetricChains (X : Type*) [PseudoMetricSpace X] where step : ℝ step_pos : 0 < step slope : ℝ slope_nonneg : 0 ≤ slope error : ℝ error_nonneg : 0 ≤ error chain : ∀ x y : X, ∃ (n : ℕ) (p : ℕ → X), p 0 = x ∧ p n = y ∧ (n : ℝ) ≤ slope * dist x y + error ∧ ∀ i < n, dist (p i) (p (i + 1)) ≤ step
/-- A compatible proper left-invariant metric with large-scale-geodesic chains. -/structure ProperChainMetric (G : Type*) [Group G] [TopologicalSpace G] where metric : MetricSpace G topology_eq : metric.toUniformSpace.toTopologicalSpace = ‹TopologicalSpace G› proper : letI := metric; ProperSpace G leftInvariant : letI := metric; IsIsometricSMul G G chains : letI := metric; LinearMetricChains G
/-- The compatible metric retains the original topology definitionally. -/abbrev ProperChainMetric.compatibleMetric {G : Type*} [Group G] [TopologicalSpace G] (d : ProperChainMetric G) : MetricSpace G := d.metric.replaceTopology d.topology_eq.symm
section Height
variable {L I : Type*} [AddCommGroup L] [Module ℝ L]
/-- The common kernel, including the empty family of characters. -/def heightKernel (χ : I → L →ₗ[ℝ] ℝ) : Submodule ℝ L := ⨅ i, (χ i).ker
/-- The canonical linear height quotient. -/abbrev HeightSpace (χ : I → L →ₗ[ℝ] ℝ) := L ⧸ heightKernel χ
/-- The quotient map defining infinitesimal height. -/def heightProjection (χ : I → L →ₗ[ℝ] ℝ) : L →ₗ[ℝ] HeightSpace χ := (heightKernel χ).mkQ
end Height
/-- A simultaneous real upper triangular basis for the adjoint representation. -/structure TriangularAdjoint (L : Type*) [LieRing L] [LieAlgebra ℝ L] (n : ℕ) where basis : Basis (Fin n) ℝ L upper : ∀ x : L, (LinearMap.toMatrix basis basis (LieAlgebra.ad ℝ L x)).IsUpperTriangular
namespace TriangularAdjoint
variable {L : Type*} [LieRing L] [LieAlgebra ℝ L] {n : ℕ}variable (T : TriangularAdjoint L n)
/-- The diagonal entries of the adjoint representation. -/noncomputable def character (i : Fin n) : L →ₗ[ℝ] ℝ where toFun x := T.basis.repr ⁅x, T.basis i⁆ i map_add' x y := by simp [add_lie] map_smul' r x := (by simp [smul_lie] : _ = r * T.basis.repr ⁅x, T.basis i⁆ i)
end TriangularAdjoint
section Exponential
attribute [local instance 10000] NormedField.toNormedSpace
variable {E G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [TopologicalSpace G] [ChartedSpace E G] [Group G] [LieGroup (𝓘(ℝ, E)) ⊤ G]
/-- The exponential is characterized by its one-parameter subgroups andby their tangent vectors at the identity. -/structure IsGroupExponential (Exp : GroupLieAlgebra (𝓘(ℝ, E)) G → G) : Prop where map_zero : Exp 0 = 1 map_add_smul : ∀ (v : GroupLieAlgebra (𝓘(ℝ, E)) G) (s t : ℝ), Exp ((s + t) • v) = Exp (s • v) * Exp (t • v) hasMFDerivAt_zero : ∀ v : GroupLieAlgebra (𝓘(ℝ, E)) G, HasMFDerivAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) (fun t : ℝ => Exp (t • v)) 0 (ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℝ ℝ) v)
end Exponential
/-- Unimodularity for the canonical Borel Haar measure of the Lie group. -/def ModelIsUnimodular (R : SimplyConnectedSolvableLieModel) : Prop := letI : IsTopologicalGroup R.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, R.modelSpace)) ⊤ letI : LocallyCompactSpace R.carrier := Manifold.locallyCompact_of_finiteDimensional (𝓘(ℝ, R.modelSpace)) letI : MeasurableSpace R.carrier := borel _ letI : BorelSpace R.carrier := ⟨rfl⟩ (Measure.haar : Measure R.carrier).IsMulRightInvariant
/-- The upper, lower, and coarse-surjectivity bounds of a self quasi-isometry. -/structure SelfQuasiIsometry (G : Type*) [PseudoMetricSpace G] (K C : ℝ) where toFun : G → G upper : ∀ x y, dist (toFun x) (toFun y) ≤ K * dist x y + C lower : ∀ x y, dist x y ≤ K * dist (toFun x) (toFun y) + K * C surjective : ∀ y, ∃ x, dist y (toFun x) ≤ C
/-- Quasi-isometric recognition, including the finite-index uniform-lattice realization. -/theorem group_recognition {P J : Type} [Group P] [Group J] [Group.FG P] [Group.FG J] (e : GroupCoarseEquivalence P J) (hP : IsVirtuallyPolycyclic P) : IsVirtuallyPolycyclic J ∧ ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by sorry
/-- One finite slope group controls the height of every self quasi-isometry. -/theorem main_uniform_bounded_height (R : SimplyConnectedSolvableLieModel) (d : ProperChainMetric R.carrier) {a : ℕ} (T : TriangularAdjoint (GroupLieAlgebra (𝓘(ℝ, R.modelSpace)) R.carrier) a) (huni : ModelIsUnimodular R) {W : Type} [NormedAddCommGroup W] [NormedSpace ℝ W] [FiniteDimensional ℝ W] (q : HeightSpace T.character ≃ₗ[ℝ] W) (Exp : GroupLieAlgebra (𝓘(ℝ, R.modelSpace)) R.carrier → R.carrier) (hExp : IsGroupExponential Exp) (π : R.carrier →* Multiplicative W) (hπExp : ∀ x, (π (Exp x)).toAdd = q (heightProjection T.character x)) : letI := d.compatibleMetric ∃ A : Subgroup (W ≃ₗ[ℝ] W), Set.Finite (A : Set (W ≃ₗ[ℝ] W)) ∧ ∀ K C : ℝ, 1 ≤ K → 0 ≤ C → ∃ B : ℝ, 0 ≤ B ∧ ∀ F : SelfQuasiIsometry R.carrier K C, ∃ AF : A, ∀ g, ‖(π (F.toFun g)).toAdd - ((π (F.toFun 1)).toAdd + AF.val (π g).toAdd)‖ ≤ B := by sorry
/-- Finite-covolume lattice recognition, allowing a different ambient Lie group. -/theorem lattice_recognition (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) (hΛ : IsFiniteCovolumeLattice Λ) {J : Type} [Group J] [Group.FG J] (e : GroupCoarseEquivalence Λ J) : ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ ∃ (R : SimplyConnectedSolvableLieModel) (Δ : Subgroup R.carrier), IsUniformLattice Δ ∧ Nonempty (Γ ≃* Δ) := by sorry
end PolycyclicRecognition
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PosteriorReplicas", "solution_module": "OAI.Probability.PosteriorReplicas.Main", "theorem_names": [ "OAI.PosteriorReplicas.source_main" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455import Mathlib
namespace OAI
section
open MeasureTheory ProbabilityTheory InformationTheory Set Matrixopen scoped ENNReal NNReal RealInnerProductSpace Classical
noncomputable section
namespace PosteriorReplicas
abbrev Vec (d : ℕ) := EuclideanSpace ℝ (Fin d)abbrev Rows (d k : ℕ) := Fin k → Vec dabbrev Labels (k : ℕ) := Fin k → ℝabbrev Data (d k : ℕ) := Rows d k × Labels kabbrev Tuple (d m : ℕ) := Fin (m + 1) → Vec d
def sphereLaw (d : ℕ) : Measure (Vec d) := let σ := (volume : Measure (Vec d)).toSphere ((σ univ)⁻¹ • σ).map Subtype.val
def gaussianRows (d k : ℕ) : Measure (Rows d k) := Measure.pi fun _ => stdGaussian (Vec d)
instance (d k : ℕ) : IsProbabilityMeasure (gaussianRows d k) := by unfold gaussianRows infer_instance
def labels {d k : ℕ} (A : Rows d k) (s : Vec d) : Labels k := fun i => ⟪A i, s⟫
lemma measurable_labels {d k : ℕ} : Measurable (fun z : Rows d k × Vec d => labels z.1 z.2) := by unfold labels fun_prop
def messageKernel {d k N : ℕ} (κ : Kernel (Data d k) (Fin N)) : Kernel (Vec d × Rows d k) (Fin N) := κ.comap (fun z => (z.2, labels z.2 z.1)) (by unfold labels fun_prop)
instance {d k N : ℕ} (κ : Kernel (Data d k) (Fin N)) [IsMarkovKernel κ] : IsMarkovKernel (messageKernel κ) := by unfold messageKernel infer_instance
def signalMessageLaw {d k N : ℕ} (p : Measure (Vec d)) (κ : Kernel (Data d k) (Fin N)) : Measure (Vec d × Fin N) := ((p.prod (gaussianRows d k)) ⊗ₘ messageKernel κ).map (fun z => (z.1.1, z.2))
instance {d k N : ℕ} (p : Measure (Vec d)) [IsProbabilityMeasure p] (κ : Kernel (Data d k) (Fin N)) [IsMarkovKernel κ] : IsProbabilityMeasure (signalMessageLaw p κ) := by unfold signalMessageLaw infer_instance
def sideLaw {d N : ℕ} (ℓ : ℕ) (q : Measure (Vec d × Fin N)) : Measure (Data d ℓ × (Vec d × Fin N)) := ((gaussianRows d ℓ).prod q).map (fun z => ((z.1, labels z.1 z.2.1), z.2))
instance {d N : ℕ} (ℓ : ℕ) (q : Measure (Vec d × Fin N)) [IsProbabilityMeasure q] : IsProbabilityMeasure (sideLaw ℓ q) := by unfold sideLaw infer_instance
def messageEntropy {d N : ℕ} (q : Measure (Vec d × Fin N)) : ℝ := ∑ w : Fin N, -(q.snd.real {w}) * Real.log (q.snd.real {w})
def conditionalInformation {d ℓ N : ℕ} [NeZero N] (μ : Measure (Data d ℓ × (Vec d × Fin N))) [IsFiniteMeasure μ] : ℝ≥0∞ := klDiv μ (μ.fst ⊗ₘ (μ.condKernel.fst ×ₖ μ.condKernel.snd))
def GaussianReplicaBlock : Prop := ∃ C : ℝ, 0 < C ∧ ∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d → let k := 2 * (d / 16) let t := k + 1 let ℓ := 4 * k ∀ (p : Measure (Vec d)) [IsProbabilityMeasure p] (f : Vec d → ℝ) (L : ℝ), Measurable f → (∀ x, 0 ≤ f x ∧ f x ≤ L) → p = (sphereLaw d).withDensity (fun x => ENNReal.ofReal (f x)) → ∀ (N : ℕ) [NeZero N] (κ : Kernel (Data d k) (Fin N)) [IsMarkovKernel κ], conditionalInformation (sideLaw ℓ (signalMessageLaw p κ)) ≤ ENNReal.ofReal (messageEntropy (signalMessageLaw p κ) / (t : ℝ) + C * (d : ℝ) + C * Real.log (2 + Real.log L))
inductive BaseLaw where | spherical | gaussian deriving DecidableEq
def BaseLaw.measure (base : BaseLaw) (d : ℕ) : Measure (Vec d) := match base with | .spherical => sphereLaw d | .gaussian => stdGaussian (Vec d)
def rowGram {d k : ℕ} (A : Rows d k) : Matrix (Fin k) (Fin k) ℝ := fun i j => ⟪A i, A j⟫
def liftLabel {d k : ℕ} (A : Rows d k) (y : Labels k) : Vec d := ∑ i, ((rowGram A)⁻¹ *ᵥ y) i • A i
def kernelComponent {d k : ℕ} (A : Rows d k) (x : Vec d) : Vec d := x - liftLabel A (labels A x)
def baseFiber {d k : ℕ} (base : BaseLaw) (A : Rows d k) (y : Labels k) : Measure (Vec d) := match base with | .gaussian => (stdGaussian (Vec d)).map (fun x => liftLabel A y + kernelComponent A x) | .spherical => (stdGaussian (Vec d)).map (fun x => liftLabel A y + (Real.sqrt (1 - ‖liftLabel A y‖ ^ 2) / ‖kernelComponent A x‖) • kernelComponent A x)
def baseDensity {d k : ℕ} (base : BaseLaw) (A : Rows d k) (y : Labels k) : ℝ≥0∞ := if LinearIndependent ℝ A then match base with | .gaussian => ENNReal.ofReal ((2 * Real.pi) ^ (-(k : ℝ) / 2) * Real.exp (-‖liftLabel A y‖ ^ 2 / 2) / Real.sqrt (rowGram A).det) | .spherical => if ‖liftLabel A y‖ < 1 then ENNReal.ofReal (Real.Gamma ((d : ℝ) / 2) / (Real.pi ^ ((k : ℝ) / 2) * Real.Gamma (((d : ℝ) - k) / 2)) * (1 - ‖liftLabel A y‖ ^ 2) ^ (((d : ℝ) - k - 2) / 2) / Real.sqrt (rowGram A).det) else 0 else 0
def tiltMass {d k : ℕ} (base : BaseLaw) (f : Vec d → ℝ≥0∞) (A : Rows d k) (y : Labels k) : ℝ≥0∞ := ∫⁻ x, f x ∂baseFiber base A y
def projectedDensity {d k : ℕ} (base : BaseLaw) (f : Vec d → ℝ≥0∞) (A : Rows d k) (y : Labels k) : ℝ≥0∞ := baseDensity base A y * tiltMass base f A y
def tiltedFiber {d k : ℕ} (base : BaseLaw) (f : Vec d → ℝ≥0∞) (A : Rows d k) (y : Labels k) : Measure (Vec d) := if tiltMass base f A y = 0 then Measure.dirac 0 else (tiltMass base f A y)⁻¹ • (baseFiber base A y).withDensity f
def differences {d m : ℕ} (u : Tuple d m) : Fin m → Vec d := fun i => u i.succ - u 0
def differenceSpan {d m : ℕ} (u : Tuple d m) : Submodule ℝ (Vec d) := Submodule.span ℝ (Set.range (differences u))
def affineVolume {d m : ℕ} (u : Tuple d m) : ℝ := Real.sqrt (Matrix.gram ℝ (differences u)).det
def constrainedRows {d m : ℕ} (k : ℕ) (u : Tuple d m) : Measure (Rows d k) := (gaussianRows d k).map (fun A i => (differenceSpan u)ᗮ.starProjection (A i))
def equalLabelLeft {d k m : ℕ} (base : BaseLaw) (f : Vec d → ℝ≥0∞) (H : Rows d k × Labels k × Tuple d m → ℝ≥0∞) : ℝ≥0∞ := ∫⁻ A, ∫⁻ y, (projectedDensity base f A y) ^ (m + 1) * ∫⁻ u, H (A, y, u) ∂Measure.pi (fun _ : Fin (m + 1) => tiltedFiber base f A y) ∂volume ∂gaussianRows d k
def equalLabelRight {d k m : ℕ} (base : BaseLaw) (f : Vec d → ℝ≥0∞) (H : Rows d k × Labels k × Tuple d m → ℝ≥0∞) : ℝ≥0∞ := ENNReal.ofReal ((2 * Real.pi) ^ (-(k * m : ℝ) / 2)) * ∫⁻ u, (ENNReal.ofReal (affineVolume u))⁻¹ ^ k * ∫⁻ A, H (A, labels A (u 0), u) ∂constrainedRows k u ∂Measure.pi (fun _ : Fin (m + 1) => (base.measure d).withDensity f)
def EqualLabelMeasureIdentity : Prop := ∀ (d k m : ℕ), 1 ≤ k → 1 ≤ m → k + m ≤ d - 2 → ∀ (base : BaseLaw) (f : Vec d → ℝ≥0∞), Measurable f → (∃ L : ℝ≥0∞, L ≠ ∞ ∧ ∀ x, f x ≤ L) → equalLabelLeft (k := k) (m := m) base f (fun _ => 1) < ∞ ∧ ∀ H : Rows d k × Labels k × Tuple d m → ℝ≥0∞, Measurable H → equalLabelLeft base f H = equalLabelRight base f H
def DistanceReplicaBlock : Prop := ∃ C : ℝ, 0 < C ∧ ∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d → ∀ (p : Measure (Vec d)) [IsProbabilityMeasure p] (f : Vec d → ℝ) (b : ℝ), 0 ≤ b → Measurable f → (∀ x, 0 ≤ f x ∧ f x ≤ Real.exp b) → p = (sphereLaw d).withDensity (fun x => ENNReal.ofReal (f x)) → ∀ (N : ℕ) [NeZero N] (κ : Kernel (Data d (d / 16)) (Fin N)) [IsMarkovKernel κ], conditionalInformation (sideLaw (d / 2) (signalMessageLaw p κ)) ≤ ENNReal.ofReal (messageEntropy (signalMessageLaw p κ) / ((d / 8 : ℕ) : ℝ) + C * ((d : ℝ) + b / (d : ℝ)))
def SyntheticReplicaBlock : Prop := ∃ C : ℝ, 0 < C ∧ ∀ d : ℕ, 16 ≤ d → ∀ (p : Measure (Vec d)) [IsProbabilityMeasure p] (f : Vec d → ℝ) (L : ℝ), 1 ≤ L → Measurable f → (∀ x, 0 ≤ f x ∧ f x ≤ L) → p = (sphereLaw d).withDensity (fun x => ENNReal.ofReal (f x)) → ∀ (N : ℕ) [NeZero N] (z : Data d (d / 8) → Fin N) (hz : Measurable z), conditionalInformation (sideLaw (d / 2) (signalMessageLaw p (Kernel.deterministic z hz))) ≤ ENNReal.ofReal (Real.log (N : ℝ) / ((d / 8 : ℕ) : ℝ) + C * ((d : ℝ) + Real.log (1 + Real.log L)))
def IncidenceReplicaBlock : Prop := ∃ C : ℝ, 0 < C ∧ ∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d → ∀ (p : Measure (Vec d)) [IsProbabilityMeasure p] (f : Vec d → ℝ) (F : ℝ), 1 ≤ F → Measurable f → (∀ x, 0 ≤ f x ∧ f x ≤ F) → p = (sphereLaw d).withDensity (fun x => ENNReal.ofReal (f x)) → ∀ (N : ℕ) [NeZero N] (κ : Kernel (Data d (d / 16)) (Fin N)) [IsMarkovKernel κ], conditionalInformation (sideLaw (d / 4) (signalMessageLaw p κ)) ≤ ENNReal.ofReal (Real.log (N : ℝ) / ((d / 16 : ℕ) : ℝ) + C * (d : ℝ) + C * Real.log (1 + Real.log F))
def labelNorm {k : ℕ} (y : Labels k) : ℝ := ‖WithLp.toLp 2 y‖
def ballDensityVersion {d k : ℕ} (ν : Measure (Vec d)) (A : Rows d k) (y : Labels k) : ℝ≥0∞ := Filter.liminf (fun n : ℕ => ((volume : Measure (Labels k)) {v | labelNorm v < (n + 1 : ℝ)⁻¹})⁻¹ * ν {x | labelNorm (labels A x - y) < (n + 1 : ℝ)⁻¹}) Filter.atTop
def gaussianDensityVersion {d k : ℕ} (ν : Measure (Vec d)) (A : Rows d k) (y : Labels k) : ℝ≥0∞ := Filter.liminf (fun n : ℕ => ∫⁻ x, ENNReal.ofReal ((2 * Real.pi * ((n + 1 : ℝ)⁻¹)^2) ^ (-(k : ℝ) / 2) * Real.exp (-(labelNorm (labels A x - y))^2 / (2 * ((n + 1 : ℝ)⁻¹)^2))) ∂ν) Filter.atTop
def EqualLabelVersions : Prop := ∀ (d k m : ℕ), 1 ≤ k → 1 ≤ m → k + m ≤ d - 2 → ∀ (base : BaseLaw) (f : Vec d → ℝ≥0∞), Measurable f → (∃ L : ℝ≥0∞, L ≠ ∞ ∧ ∀ x, f x ≤ L) → let ν := (base.measure d).withDensity f (Measurable (fun z : Rows d k × Labels k => projectedDensity base f z.1 z.2)) ∧ (Measurable (fun z : Rows d k × Labels k => ballDensityVersion ν z.1 z.2)) ∧ (Measurable (fun z : Rows d k × Labels k => gaussianDensityVersion ν z.1 z.2)) ∧ (∀ A : Rows d k, LinearIndependent ℝ A → ν.map (labels A) = volume.withDensity (projectedDensity base f A) ∧ projectedDensity base f A =ᵐ[volume] ballDensityVersion ν A ∧ projectedDensity base f A =ᵐ[volume] gaussianDensityVersion ν A) ∧ (∀ᵐ u ∂Measure.pi (fun _ : Fin (m + 1) => ν), LinearIndependent ℝ (differences u) ∧ ∀ᵐ A ∂constrainedRows k u, LinearIndependent ℝ A ∧ (∀ i, labels A (u i) = labels A (u 0)) ∧ (base = .spherical → ‖liftLabel A (labels A (u 0))‖ < 1) ∧ 0 < projectedDensity base f A (labels A (u 0)) ∧ projectedDensity base f A (labels A (u 0)) ≠ ∞ ∧ projectedDensity base f A (labels A (u 0)) = ballDensityVersion ν A (labels A (u 0)) ∧ projectedDensity base f A (labels A (u 0)) = gaussianDensityVersion ν A (labels A (u 0)))
def haarRows (d ℓ : ℕ) : Measure (Rows d ℓ) := (gaussianRows d ℓ).map (InnerProductSpace.gramSchmidtNormed ℝ)
def cmi {Z X Y : Type*} [MeasurableSpace Z] [MeasurableSpace X] [MeasurableSpace Y] [StandardBorelSpace X] [StandardBorelSpace Y] [Nonempty X] [Nonempty Y] (μ : Measure (Z × (X × Y))) [IsFiniteMeasure μ] : ℝ≥0∞ := klDiv μ (μ.fst ⊗ₘ (μ.condKernel.fst ×ₖ μ.condKernel.snd))
def finiteEntropy {J : Type*} [Fintype J] [MeasurableSpace J] (μ : Measure J) : ℝ := ∑ j, - μ.real {j} * Real.log (μ.real {j})
def stateMessageKernel {d k V W : ℕ} (κ : Kernel (Fin V × Data d k) (Fin W)) : Kernel ((Vec d × Fin V) × Rows d k) (Fin W) := κ.comap (fun z => (z.1.2, (z.2, labels z.2 z.1.1))) (by unfold labels; fun_prop)
instance {d k V W : ℕ} (κ : Kernel (Fin V × Data d k) (Fin W)) [IsMarkovKernel κ] : IsMarkovKernel (stateMessageKernel κ) := by unfold stateMessageKernel infer_instance
def stateMessageLaw {d k V W : ℕ} (q : Measure (Vec d × Fin V)) (κ : Kernel (Fin V × Data d k) (Fin W)) : Measure ((Vec d × Fin V) × Fin W) := (((q.prod (gaussianRows d k)) ⊗ₘ stateMessageKernel κ).map (fun z => (z.1.1, z.2)))
instance {d k V W : ℕ} (q : Measure (Vec d × Fin V)) [IsProbabilityMeasure q] (κ : Kernel (Fin V × Data d k) (Fin W)) [IsMarkovKernel κ] : IsProbabilityMeasure (stateMessageLaw q κ) := by unfold stateMessageLaw infer_instance
def stateHaarSideLaw {d V W : ℕ} (ℓ : ℕ) (q : Measure ((Vec d × Fin V) × Fin W)) : Measure ((Fin V × Data d ℓ) × (Vec d × Fin W)) := ((haarRows d ℓ).prod q).map (fun z => ((z.2.1.2, (z.1, labels z.1 z.2.1.1)), (z.2.1.1, z.2.2)))
instance {d V W : ℕ} (ℓ : ℕ) (q : Measure ((Vec d × Fin V) × Fin W)) [IsFiniteMeasure q] : IsFiniteMeasure (stateHaarSideLaw ℓ q) := by unfold stateHaarSideLaw haarRows infer_instance
def terminalConditionalEntropy {d V W : ℕ} (q : Measure ((Vec d × Fin V) × Fin W)) : ℝ := finiteEntropy (q.map (fun z => (z.1.2, z.2))) - finiteEntropy (q.map (fun z => z.1.2))
def HaarReplicaBlock : Prop := ∃ C : ℝ, 0 < C ∧ ∀ d : ℕ, 64 ≤ d → ∀ (V W : ℕ) [NeZero V] [NeZero W] (q : Measure (Vec d × Fin V)) [IsProbabilityMeasure q], q.fst = sphereLaw d → ∀ (κ : Kernel (Fin V × Data d (d / 16)) (Fin W)) [IsMarkovKernel κ], cmi (stateHaarSideLaw (d / 4) (stateMessageLaw q κ)) ≤ ENNReal.ofReal (terminalConditionalEntropy (stateMessageLaw q κ) / ((d / 16 + 1 : ℕ) : ℝ) + C * (d : ℝ) + Real.log (1 + C * (d : ℝ) + finiteEntropy q.snd) + C * (finiteEntropy q.snd + Real.log (d : ℝ)) / (d : ℝ)^2)
end PosteriorReplicasendend
open MeasureTheory ProbabilityTheory Set Filteropen scoped ENNReal NNReal RealInnerProductSpace
noncomputable section
universe u
namespace PosteriorRegression
abbrev Vector (d : ℕ) := EuclideanSpace ℝ (Fin d)abbrev UnitSphere (d : ℕ) := Metric.sphere (0 : Vector d) 1abbrev State (M : ℕ) := Fin (2 ^ M)abbrev Samples (d T : ℕ) := Fin T → Vector d
def uniformSphere (d : ℕ) : Measure (UnitSphere d) := let σ := (volume : Measure (Vector d)).toSphere (σ Set.univ)⁻¹ • σ
def sampleLaw (d T : ℕ) : Measure (Samples d T) := Measure.pi fun _ => stdGaussian (Vector d)
def observationReference (d : ℕ) : Measure (Vector d × ℝ) := (stdGaussian (Vector d)).prod volume
namespace Learner
abbrev RunStatus (M : ℕ) := Sum (State M) (ℕ × State M)
def angularError {d : ℕ} (s ŝ : UnitSphere d) : ℝ := Real.arccos ⟪ŝ.val, s.val⟫
end Learner
end PosteriorRegression
open MeasureTheory ProbabilityTheory InformationTheory Set Matrixopen scoped ENNReal NNReal RealInnerProductSpace Classical
noncomputable section
namespace PosteriorRegressionabbrev CompletedObservation (d : ℕ) := NullMeasurableSpace (Vector d × ℝ) (observationReference d)abbrev Destination (M : ℕ) := Bool × State M
structure CompletedKernelLearner (d M : ℕ) where initial : Measure (Destination M) initial_probability : IsProbabilityMeasure initial transition : ℕ → State M → Kernel (CompletedObservation d) (Destination M) transition_markov : ∀ t a, IsMarkovKernel (transition t a) output : ℕ → State M → Measure (UnitSphere d) output_probability : ∀ t a, IsProbabilityMeasure (output t a)
attribute [instance] CompletedKernelLearner.initial_probability CompletedKernelLearner.transition_markov CompletedKernelLearner.output_probability
namespace CompletedKernelLearneropen Learnerdef destStatus {M : ℕ} (n : ℕ) (v : Destination M) : RunStatus M := if v.1 then Sum.inr (n,v.2) else Sum.inl v.2
def finishState {M : ℕ} (T : ℕ) : RunStatus M → ℕ × State M | .inl a => (T,a) | .inr done => done
def stepMeasure {d M T : ℕ} (K : CompletedKernelLearner d M) (s : UnitSphere d) (x : Samples d T) (i : Fin T) : RunStatus M → Measure (RunStatus M) | .inr done => Measure.dirac (.inr done) | .inl a => (K.transition (i.val+1) a (x i,⟪x i,s.val⟫)).map (destStatus (i.val+1))
def runMeasure {d M T : ℕ} (K : CompletedKernelLearner d M) (s : UnitSphere d) (x : Samples d T) : ℕ → Measure (RunStatus M) | 0 => K.initial.map (destStatus 0) | n+1 => if hn : n<T then (K.runMeasure s x n).bind (K.stepMeasure s x ⟨n,hn⟩) else K.runMeasure s x n
def terminalLaw {d M T : ℕ} (K : CompletedKernelLearner d M) (s : UnitSphere d) (x : Samples d T) : Measure (ℕ × State M) := (K.runMeasure s x T).map (finishState T)
def estimateLaw {d M T : ℕ} (K : CompletedKernelLearner d M) (s : UnitSphere d) (x : Samples d T) : Measure (UnitSphere d) := (K.terminalLaw s x).bind (fun a => K.output a.1 a.2)
end CompletedKernelLearner
structure JointKernelExperiment (d M T : ℕ) (Ω : Type u) [MeasurableSpace Ω] (ρ : Measure Ω) where rules : Ω → CompletedKernelLearner d M outputKernel : Kernel (Ω × (UnitSphere d × Samples d T)) (UnitSphere d) output_markov : IsMarkovKernel outputKernel conditional_output : ∀ᵐ ω ∂ρ, ∀ᵐ z ∂((uniformSphere d).prod (sampleLaw d T)), outputKernel (ω,z) = (rules ω).estimateLaw z.1 z.2
attribute [instance] JointKernelExperiment.output_markov
namespace JointKernelExperimentopen Learnerdef law {d M T : ℕ} {Ω : Type u} [MeasurableSpace Ω] {ρ : Measure Ω} (E : JointKernelExperiment d M T Ω ρ) : Measure ((Ω × (UnitSphere d × Samples d T)) × UnitSphere d) := (ρ.prod ((uniformSphere d).prod (sampleLaw d T))) ⊗ₘ E.outputKernel
def uniformSuccess {d M T : ℕ} {Ω : Type u} [MeasurableSpace Ω] {ρ : Measure Ω} (E : JointKernelExperiment d M T Ω ρ) (ε : ℝ) : ℝ≥0∞ := E.law {z | angularError z.1.2.1 z.2 ≤ ε}
end JointKernelExperiment
def KernelSubquadraticMemory : Prop := ∃ c : ℝ, 0 < c ∧ ∀ M : ℕ → ℕ, Asymptotics.IsLittleO atTop (fun d => (M d : ℝ)) (fun d => (d : ℝ)^2) → ∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d → ∀ T : ℕ, ∀ ε : ℝ, 0<ε → ε≤1/10 → ∀ (Ω : Type u) [MeasurableSpace Ω] (ρ : Measure Ω), IsProbabilityMeasure ρ → ∀ E : JointKernelExperiment d (M d) T Ω ρ, (2/3 : ℝ≥0∞) ≤ E.uniformSuccess ε → c * (d : ℝ) * Real.log (1/ε) ≤ (T : ℝ)
end PosteriorRegression
namespace PosteriorReplicas
end PosteriorReplicasendend
namespace PosteriorReplicas
universe u
theorem source_main : EqualLabelMeasureIdentity ∧ EqualLabelVersions ∧ GaussianReplicaBlock ∧ DistanceReplicaBlock ∧ HaarReplicaBlock ∧ SyntheticReplicaBlock ∧ IncidenceReplicaBlock ∧ PosteriorRegression.KernelSubquadraticMemory.{u} := by sorry
end PosteriorReplicas
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PowerFreeValues", "solution_module": "OAI.NumberTheory.PowerFree.Main", "theorem_names": [ "OAI.QuarticPowerFree.allDegrees" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}12345678910111213141516171819202122232425262728293031323334353637383940414243444546import Mathlib
namespace OAI
open Filter Asymptoticsopen scoped Topology
namespace QuarticPowerFree
def PowerFree (k : ℕ) (a : ℤ) : Prop := ∀ p : ℕ, p.Prime → ¬ (p : ℤ) ^ k ∣ a
def rho (f : Polynomial ℤ) (q : ℕ) : ℕ := ((Finset.range q).filter fun a : ℕ => (q : ℤ) ∣ f.eval (a : ℤ)).card
noncomputable def count (f : Polynomial ℤ) (k : ℕ) (X : ℝ) : ℕ := by classical exact ((Finset.Icc 1 ⌊X⌋₊).filter fun n : ℕ => PowerFree k (f.eval (n : ℤ))).card
def LocallyAdmissible (f : Polynomial ℤ) (k : ℕ) : Prop := ∀ p : ℕ, p.Prime → rho f (p ^ k) < p ^ k
noncomputable def localFactor (f : Polynomial ℤ) (k : ℕ) (p : Nat.Primes) : ℝ := 1 - (rho f (p.val ^ k) : ℝ) / (p.val : ℝ) ^ k
noncomputable def densityConstant (f : Polynomial ℤ) (k : ℕ) : ℝ := ∏' p : Nat.Primes, localFactor f k p
def DensityStatement (f : Polynomial ℤ) (k : ℕ) : Prop := Multipliable (localFactor f k) ∧ 0 < densityConstant f k ∧ (fun X : ℝ => (count f k X : ℝ) - densityConstant f k * X) =o[atTop] (fun X : ℝ => X)
theorem allDegrees (f : Polynomial ℤ) (hirr : Irreducible (f.map (Int.castRingHom ℚ))) (hdeglo : 4 ≤ f.natDegree) (hlocal : LocallyAdmissible f (f.natDegree - 2)) : DensityStatement f (f.natDegree - 2) := by sorry
end QuarticPowerFree
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.PrimeGaps", "solution_module": "OAI.NumberTheory.PrimeGaps.RatioCorollary", "theorem_names": [ "OAI.Problem344.large_gaps_and_ratio_density" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647import Mathlib
namespace OAI
namespace LargePrimeGaps
noncomputable def prime (n : ℕ) : ℕ := Nat.nth Nat.Prime (n - 1)
noncomputable def largeGapIndices (C : ℝ) (N : ℕ) : Finset ℕ := by classical exact (Finset.Icc 1 N).filter fun n => C * Real.log (prime n : ℝ) < (prime (n + 1) : ℝ) - (prime n : ℝ)
end LargePrimeGaps
noncomputable section
namespace Problem344
def primeAt (n : ℕ) : ℕ := Nat.nth Nat.Prime (n - 1)
def initialCount (A : Set ℕ) (N : ℕ) : ℕ := by classical exact ((Finset.Icc 1 N).filter (fun n => n ∈ A)).card
def lowerAsymptoticDensity (A : Set ℕ) : ℝ := sSup {d : ℝ | ∃ N0 : ℕ, ∀ N : ℕ, N0 ≤ N → d ≤ (initialCount A N : ℝ) / (N : ℝ)}
def ratioIncreaseIndices : Set ℕ := {n | 1 ≤ n ∧ (primeAt n : ℝ) / (n : ℝ) < (primeAt (n + 1) : ℝ) / ((n + 1 : ℕ) : ℝ)}
theorem large_gaps_and_ratio_density : (∀ C : ℝ, 0 < C → ∃ c : ℝ, 0 < c ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → c * (N : ℝ) ≤ ((LargePrimeGaps.largeGapIndices C N).card : ℝ)) ∧ 0 < lowerAsymptoticDensity ratioIncreaseIndices := by sorry
end Problem344
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.ProductBrown", "solution_module": "OAI.Analysis.BrownMeasure.Main", "theorem_names": [ "OAI.FiniteFactor.productBrown" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757import Mathlib
namespace OAI
sectionnoncomputable sectionopen Polynomialnamespace FiniteFactor
theorem product_has_low_nonzero_coeff (K : ℕ) (p q : ℂ[X]) (hp : p.coeff K ≠ 0) (hq : q.coeff K ≠ 0) : ∃ n ≤ 2 * K, (p * q).coeff n ≠ 0 := by have hp0 : p ≠ 0 := by intro h; simp [h] at hp have hq0 : q ≠ 0 := by intro h; simp [h] at hq refine ⟨(p * q).natTrailingDegree, ?_, Polynomial.coeff_natTrailingDegree_ne_zero.mpr (mul_ne_zero hp0 hq0)⟩ rw [Polynomial.natTrailingDegree_mul hp0 hq0] have ha := Polynomial.natTrailingDegree_le_of_ne_zero hp have hb := Polynomial.natTrailingDegree_le_of_ne_zero hq omega
abbrev Coefficients (K : ℕ) := Fin (2 * K + 1) → ℂ
noncomputable def coefficientPolynomial {K : ℕ} (a : Coefficients K) : ℂ[X] := ∑ i : Fin (2 * K + 1), Polynomial.monomial i.val (a i)
theorem coefficientPolynomial_coeff {K : ℕ} (a : Coefficients K) (i : Fin (2 * K + 1)) : (coefficientPolynomial a).coeff i.val = a i := by classical simp [coefficientPolynomial, Polynomial.finsetSum_coeff, Polynomial.coeff_monomial, Fin.val_inj]
noncomputable def productCoefficient {K : ℕ} (a b : Coefficients K) (n : ℕ) : ℂ := ∑ i : Fin (2 * K + 1), ∑ j : Fin (2 * K + 1), if i.val + j.val = n then a i * b j else 0
theorem productCoefficient_eq {K : ℕ} (a b : Coefficients K) (n : ℕ) : productCoefficient a b n = (coefficientPolynomial a * coefficientPolynomial b).coeff n := by classical simp only [productCoefficient, coefficientPolynomial, Finset.sum_mul, Finset.mul_sum, Polynomial.monomial_mul_monomial, Polynomial.finsetSum_coeff, Polynomial.coeff_monomial] exact Finset.sum_comm
theorem continuous_productCoefficient (K n : ℕ) : Continuous (fun ab : Coefficients K × Coefficients K => productCoefficient ab.1 ab.2 n) := by classical unfold productCoefficient apply continuous_finsetSum intro i _ apply continuous_finsetSum intro j _ split_ifs <;> fun_prop
noncomputable def lowCoefficients {K : ℕ} (ab : Coefficients K × Coefficients K) : Coefficients K := fun n => productCoefficient ab.1 ab.2 n.val
theorem continuous_lowCoefficients (K : ℕ) : Continuous (@lowCoefficients K) := continuous_pi fun n => continuous_productCoefficient K n.val
theorem lowCoefficients_ne_zero {K : ℕ} (ab : Coefficients K × Coefficients K) (ha : ab.1 ⟨K, by omega⟩ ≠ 0) (hb : ab.2 ⟨K, by omega⟩ ≠ 0) : lowCoefficients ab ≠ 0 := by have ha' : (coefficientPolynomial ab.1).coeff K ≠ 0 := by simpa using (coefficientPolynomial_coeff ab.1 ⟨K, by omega⟩).trans_ne ha have hb' : (coefficientPolynomial ab.2).coeff K ≠ 0 := by simpa using (coefficientPolynomial_coeff ab.2 ⟨K, by omega⟩).trans_ne hb obtain ⟨n, hn, hne⟩ := product_has_low_nonzero_coeff K _ _ ha' hb' intro h have hz := congrFun h ⟨n, by omega⟩ exact hne (by simpa [lowCoefficients, productCoefficient_eq] using hz)
def admissibleCoefficients (K : ℕ) (D δ : ℝ) : Set (Coefficients K) := {a | ∀ i, ‖a i‖ ≤ D} ∩ {a | δ ≤ ‖a ⟨K, by omega⟩‖}
theorem isCompact_admissibleCoefficients (K : ℕ) (D δ : ℝ) : IsCompact (admissibleCoefficients K D δ) := by have hc : IsCompact {a : Coefficients K | ∀ i, ‖a i‖ ≤ D} := by simpa [Set.pi, Metric.mem_closedBall, dist_zero_right] using (isCompact_pi_infinite fun _ : Fin (2 * K + 1) => isCompact_closedBall (0 : ℂ) D) exact hc.inter_right (isClosed_le continuous_const (continuous_apply (⟨K, by omega⟩ : Fin (2 * K + 1))).norm)
theorem uniform_product_coefficient_bound (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : ∃ ε : ℝ, 0 < ε ∧ ∀ a b : Coefficients K, (∀ i, ‖a i‖ ≤ D) → (∀ i, ‖b i‖ ≤ D) → δ ≤ ‖a ⟨K, by omega⟩‖ → δ ≤ ‖b ⟨K, by omega⟩‖ → ∃ n : Fin (2 * K + 1), ε ≤ ‖productCoefficient a b n.val‖ := by classical let S := (admissibleCoefficients K D δ).prod (admissibleCoefficients K D δ) have hc : IsCompact S := (isCompact_admissibleCoefficients K D δ).prod (isCompact_admissibleCoefficients K D δ) by_cases hs : S.Nonempty · obtain ⟨ab, hab, hmin⟩ := hc.exists_isMinOn hs (continuous_lowCoefficients K).norm.continuousOn have hpos : 0 < ‖lowCoefficients ab‖ := by apply norm_pos_iff.mpr apply lowCoefficients_ne_zero · exact norm_pos_iff.mp (hδ.trans_le hab.1.2) · exact norm_pos_iff.mp (hδ.trans_le hab.2.2) refine ⟨‖lowCoefficients ab‖, hpos, ?_⟩ intro a b ha hb ha0 hb0 have hm : ‖lowCoefficients ab‖ ≤ ‖lowCoefficients (a, b)‖ := hmin ⟨⟨ha, ha0⟩, ⟨hb, hb0⟩⟩ by_contra hn push Not at hn have hlt : ‖lowCoefficients (a, b)‖ < ‖lowCoefficients ab‖ := (pi_norm_lt_iff hpos).mpr hn exact (not_lt_of_ge hm) hlt · refine ⟨1, zero_lt_one, ?_⟩ intro a b ha hb ha0 hb0 exact False.elim (hs ⟨(a, b), ⟨⟨ha, ha0⟩, ⟨hb, hb0⟩⟩⟩)
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheoryopen scoped ENNRealnamespace FiniteFactor
def unitIntervalMeasure : Measure ℝ := volume.restrict (Set.Ico 0 1)
instance : IsProbabilityMeasure unitIntervalMeasure := by constructor simp [unitIntervalMeasure, Real.volume_Ico]
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheoryopen scoped ENNRealnamespace FiniteFactor
def sourceKappa (s : ℕ) : ℝ := 1 / (100*((s : ℝ)+1))
end FiniteFactorendend
sectionnoncomputable sectionopen Filter Finsetopen scoped Topologynamespace FiniteFactor
def sourceNextCutoff (m : ℕ) : ℕ := Nat.ceil ((m : ℝ)^((3/4 : ℝ)*(m : ℝ)))
theorem sourceNextCutoff_large (m : ℕ) (hm : 100 ≤ m) : 2*m < sourceNextCutoff m := by have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm have hp : (m : ℝ)^2 ≤ (m : ℝ)^((3/4 : ℝ)*(m : ℝ)) := by rw [← Real.rpow_natCast] exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num; linarith) have hh := hp.trans (Nat.le_ceil _) have hh2 : (2 : ℝ)*m < (sourceNextCutoff m : ℝ) := by change (m : ℝ)^2 ≤ (sourceNextCutoff m : ℝ) at hh nlinarith exact_mod_cast hh2
theorem exists_source_block_length (R κ L G : ℝ) (hκ : 0 < κ) (hG : 0 < G) : ∃ m : ℕ, R ≤ (m : ℝ) ∧ 100 ≤ m ∧ κ*(m : ℝ)^(1/40 : ℝ) ≥ L ∧ G*(sourceNextCutoff m : ℝ) < (m : ℝ)^((4/5 : ℝ)*(m : ℝ)) := by have ht : Tendsto (fun m : ℕ => (m : ℝ)^(1/40 : ℝ)) atTop atTop := (tendsto_rpow_atTop (by norm_num)).comp tendsto_natCast_atTop_atTop obtain ⟨m, hmR, hm100, hmG, hmκ⟩ := ((tendsto_natCast_atTop_atTop.eventually (eventually_ge_atTop R)).and ((eventually_ge_atTop (100 : ℕ)).and ((tendsto_natCast_atTop_atTop.eventually (eventually_gt_atTop (2*G))).and (ht.eventually (eventually_ge_atTop (L/κ)))))).exists refine ⟨m, hmR, hm100, (div_le_iff₀ hκ).mp hmκ |>.trans_eq (mul_comm _ _), ?_⟩ have hm1 : (1 : ℝ) ≤ m := by exact_mod_cast (show 1 ≤ m by omega) have hm0 : (0 : ℝ) < m := lt_of_lt_of_le zero_lt_one hm1 let A : ℝ := (m : ℝ)^((3/4 : ℝ)*(m : ℝ)) have hApos : 0 < A := Real.rpow_pos_of_pos hm0 _ have hA1 : 1 ≤ A := Real.one_le_rpow hm1 (by positivity) have hceil : (sourceNextCutoff m : ℝ) ≤ 2*A := by have hh := Nat.ceil_lt_add_one hApos.le change (Nat.ceil A : ℝ) ≤ 2*A linarith calc G*(sourceNextCutoff m : ℝ) ≤ G*(2*A) := mul_le_mul_of_nonneg_left hceil hG.le _ < (m : ℝ)*A := by nlinarith _ = (m : ℝ)^((3/4 : ℝ)*(m : ℝ)+1) := by rw [Real.rpow_add hm0, Real.rpow_one]; ring _ ≤ (m : ℝ)^((4/5 : ℝ)*(m : ℝ)) := Real.rpow_le_rpow_of_exponent_le hm1 (by have hh : (100 : ℝ) ≤ m := by exact_mod_cast hm100 linarith)
structure SourceStageState where K : ℕ G : ℝ d : ℕ B : ℝ previousL : ℝ K_ge : 1 ≤ K G_ge : 1 ≤ G B_nonneg : 0 ≤ B previousL_ge : 1 ≤ previousL
def SourceStageState.D (a : SourceStageState) : ℝ := Real.exp (((a.K : ℝ)+1)*a.B)
structure SourceStageChoice (s : ℕ) (a : SourceStageState) where ε : ℝ L : ℝ Gnext : ℝ m : ℕ ε_pos : 0 < ε polynomial : ∀ u v : Coefficients a.K, (∀ i, ‖u i‖ ≤ a.D) → (∀ i, ‖v i‖ ≤ a.D) → 1/((s : ℝ)+1) ≤ ‖u ⟨a.K, by omega⟩‖ → 1/((s : ℝ)+1) ≤ ‖v ⟨a.K, by omega⟩‖ → ∃ n : Fin (2*a.K+1), ε ≤ ‖productCoefficient u v n.val‖ L_ge : a.previousL ≤ L decay : ((2*a.K : ℕ)+1 : ℝ)*3*Real.exp (-L/10000) ≤ ε/((s : ℝ)+1) Gnext_ge : 1 ≤ Gnext next_budget : sourceKappa (s+1) * Real.sqrt Gnext ≥ L m_ge_K : a.K ≤ m m_ge_pow : 2^(s+1) ≤ m m_ge_G : 4*a.G ≤ (m : ℝ) m_ge_100 : 100 ≤ m previous_size : (a.d : ℝ) ≤ (m : ℝ)/100 current_budget : sourceKappa s * (m : ℝ)^(1/40 : ℝ) ≥ L next_gap : Gnext*(sourceNextCutoff m : ℝ) < (m : ℝ)^((4/5 : ℝ)*(m : ℝ))
theorem exists_sourceStageChoice (s : ℕ) (a : SourceStageState) : Nonempty (SourceStageChoice s a) := by have hs : 0 < (s : ℝ)+1 := by positivity have hk (j : ℕ) : 0 < sourceKappa j := by unfold sourceKappa; positivity obtain ⟨ε, hε, hp⟩ := uniform_product_coefficient_bound a.K a.D (1/((s : ℝ)+1)) (by positivity) let target : ℝ := (ε/((s : ℝ)+1))/(((2*a.K : ℕ)+1 : ℝ)*3) have ht : 0 < target := by dsimp [target]; positivity obtain ⟨t, htL, htt⟩ := ((eventually_ge_atTop (a.previousL/10000)).and (Real.tendsto_exp_neg_atTop_nhds_zero.eventually (gt_mem_nhds ht))).exists let L : ℝ := 10000*t have hL : a.previousL ≤ L := by dsimp [L]; linarith have hLpos : 0 < L := lt_of_lt_of_le (by linarith [a.previousL_ge]) hL let G : ℝ := (1+L/sourceKappa (s+1))^2 have hG : 1 ≤ G := by dsimp [G]; nlinarith [div_pos hLpos (hk (s+1))] have hbudget : L ≤ sourceKappa (s+1)*Real.sqrt G := by rw [show Real.sqrt G = 1+L/sourceKappa (s+1) by dsimp [G]; rw [Real.sqrt_sq (by linarith [div_pos hLpos (hk (s+1))])]] rw [mul_add, mul_one, mul_div_cancel₀ _ (hk (s+1)).ne'] linarith [hk (s+1)] let R : ℝ := max (a.K : ℝ) (max ((2^(s+1) : ℕ) : ℝ) (max (4*a.G) (100*(a.d : ℝ)))) obtain ⟨m, hmR, hm100, hmκ, hmgap⟩ := exists_source_block_length R (sourceKappa s) L G (hk s) (by linarith) have hmK : (a.K : ℝ) ≤ m := (le_max_left _ _).trans hmR have hm2 : (((2^(s+1) : ℕ)) : ℝ) ≤ m := (le_max_left _ _).trans ((le_max_right _ _).trans hmR) have hmG : 4*a.G ≤ (m : ℝ) := (le_max_left _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans hmR)) have hmd : 100*(a.d : ℝ) ≤ m := (le_max_right _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans hmR)) refine ⟨⟨ε, L, G, m, hε, hp, hL, ?_, hG, hbudget, by exact_mod_cast hmK, by exact_mod_cast hm2, hmG, hm100, by linarith, hmκ, hmgap⟩⟩ have hden : 0 < (((2*a.K : ℕ)+1 : ℝ)*3) := by positivity have htt' := (lt_div_iff₀ hden).mp htt have he : -L/10000 = -t := by dsimp [L]; ring rw [he] nlinarith
def selectedSourceStage (s : ℕ) (a : SourceStageState) : SourceStageChoice s a := Classical.choice (exists_sourceStageChoice s a)
def SourceStageChoice.C {s : ℕ} {a : SourceStageState} (b : SourceStageChoice s a) : ℝ := max b.L ((a.K : ℝ)^2)
def SourceStageChoice.next {s : ℕ} {a : SourceStageState} (b : SourceStageChoice s a) : SourceStageState where K := sourceNextCutoff b.m G := b.Gnext d := a.d+b.m B := a.B+b.C*(b.m : ℝ) previousL := b.L K_ge := by have := sourceNextCutoff_large b.m b.m_ge_100; omega G_ge := b.Gnext_ge B_nonneg := add_nonneg a.B_nonneg (mul_nonneg (le_max_of_le_right (sq_nonneg _)) (Nat.cast_nonneg _)) previousL_ge := a.previousL_ge.trans b.L_ge
def sourceStageState : ℕ → SourceStageState | 0 => ⟨100, 1, 0, 0, 1, by norm_num, le_rfl, le_rfl, le_rfl⟩ | s+1 => (selectedSourceStage s (sourceStageState s)).next
def sourceStage (s : ℕ) : SourceStageChoice s (sourceStageState s) := selectedSourceStage s (sourceStageState s)
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filteropen scoped ENNRealnamespace FiniteFactor
def coordinateFloor {ι : Type*} (θ : ι → ℝ) (k : ℤ) (x : ι → ℝ) (i : ι) : ℤ := Int.floor (x i + (k : ℝ)*θ i)
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filteropen scoped ENNRealnamespace FiniteFactor
def coordinateRotate {ι : Type*} (θ : ι → ℝ) (k : ℤ) (x : ι → ℝ) (i : ι) : ℝ := Int.fract (x i + (k : ℝ)*θ i)
def sourceLog {ι : Type*} (θ c : ι → ℝ) (k : ℤ) (x : ι → ℝ) : ℝ := ∑' i, c i * (coordinateFloor θ k x i : ℝ)
def sourceCocycle {ι : Type*} (θ c : ι → ℝ) (k : ℤ) (x : ι → ℝ) : ℝ := Real.exp (-sourceLog θ c k x)
theorem sourceCocycle_pos {ι : Type*} (θ c : ι → ℝ) (k : ℤ) (x : ι → ℝ) : 0 < sourceCocycle θ c k x := Real.exp_pos _
theorem sourceCocycle_measurable {ι : Type*} [Countable ι] (θ c : ι → ℝ) (k : ℤ) : @Measurable (ι → ℝ) ℝ (@MeasurableSpace.pi ι (fun _ => ℝ) (fun _ => Real.measurableSpace)) Real.measurableSpace (sourceCocycle θ c k) := by apply Real.continuous_exp.measurable.comp apply Measurable.neg apply Measurable.tsum intro i have hm0 : Measurable (fun x : ι → ℝ => x i + (k : ℝ)*θ i) := (measurable_pi_apply i).add measurable_const have hm := Int.measurable_floor.comp hm0 exact measurable_const.mul ((measurable_of_countable (fun z : ℤ => (z : ℝ))).comp hm)
theorem sourceWeight_le_one {ι : Type*} (θ c : ι → ℝ) (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) {x : ι → ℝ} (hx : ∀ i, x i ∈ Set.Ico 0 1) : sourceCocycle θ c 1 x ≤ 1 := by apply Real.exp_le_one_iff.mpr apply neg_nonpos.mpr apply tsum_nonneg intro i apply mul_nonneg (hc i) unfold coordinateFloor exact_mod_cast Int.floor_nonneg.mpr (show 0 ≤ x i + (1 : ℤ)*θ i by simpa using add_nonneg (hx i).1 (hθ i))
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filteropen scoped ENNRealnamespace FiniteFactor
abbrev sourceMeasure (ι : Type*) : Measure ((ι → ℝ) × ℤ) := (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)).prod Measure.count
abbrev SourceHilbert (ι : Type*) : Type _ := Lp ℂ 2 (sourceMeasure ι)
def sourceDiagonal {ι : Type*} (θ c : ι → ℝ) (z : (ι → ℝ) × ℤ) : ℂ := sourceCocycle θ c 1 (coordinateRotate θ z.2 z.1)
theorem sourceDiagonal_measurable {ι : Type*} [Countable ι] (θ c : ι → ℝ) : Measurable (sourceDiagonal θ c) := by apply Complex.measurable_ofReal.comp apply (sourceCocycle_measurable θ c 1).comp apply Measurable.of_eval intro i unfold coordinateRotate fun_prop
theorem sourceDiagonal_norm_le {ι : Type*} (θ c : ι → ℝ) (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (z : (ι → ℝ) × ℤ) : ‖sourceDiagonal θ c z‖ ≤ 1 := by rw [sourceDiagonal, Complex.norm_real, Real.norm_of_nonneg (sourceCocycle_pos _ _ _ _).le] apply sourceWeight_le_one θ c hθ hc intro i exact ⟨Int.fract_nonneg _, Int.fract_lt_one _⟩
theorem sourceDiagonal_memLp {ι : Type*} [Countable ι] (θ c : ι → ℝ) (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : MemLp (sourceDiagonal θ c) ∞ (sourceMeasure ι) := memLp_top_of_bound (sourceDiagonal_measurable θ c).aestronglyMeasurable 1 (Eventually.of_forall (sourceDiagonal_norm_le θ c hθ hc))
def sourceMultiplication {ι : Type*} [Countable ι] (θ c : ι → ℝ) (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : SourceHilbert ι →L[ℂ] SourceHilbert ι := (ContinuousLinearMap.mul ℂ ℂ).holderL (sourceMeasure ι) ∞ 2 2 ((sourceDiagonal_memLp θ c hθ hc).toLp (sourceDiagonal θ c))
def sourceShiftIndex {ι : Type*} (z : (ι → ℝ) × ℤ) : (ι → ℝ) × ℤ := (z.1, z.2-1)
theorem sourceShiftIndex_preserving (ι : Type*) : MeasurePreserving (sourceShiftIndex (ι := ι)) (sourceMeasure ι) (sourceMeasure ι) := by have hm : Measurable (fun k : ℤ => k-1) := measurable_of_countable _ have hi : Function.Injective (fun k : ℤ => k-1) := by intro a b h; dsimp at h; omega have hs : Function.Surjective (fun k : ℤ => k-1) := by intro k; exact ⟨k+1, by dsimp; omega⟩ have hp : MeasurePreserving (fun k : ℤ => k-1) Measure.count Measure.count := by refine ⟨hm, ?_⟩ ext S hS rw [Measure.map_apply hm hS, Measure.count_apply (hS.preimage hm), Measure.count_apply hS, ← hi.encard_image, Set.image_preimage_eq S hs] exact (MeasurePreserving.id _).prod hp
def sourceShift (ι : Type*) : SourceHilbert ι →L[ℂ] SourceHilbert ι := (Lp.compMeasurePreservingₗᵢ ℂ sourceShiftIndex (sourceShiftIndex_preserving ι)).toContinuousLinearMap
def sourceOperator {ι : Type*} [Countable ι] (θ c : ι → ℝ) (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : SourceHilbert ι →L[ℂ] SourceHilbert ι := (sourceShift ι).comp (sourceMultiplication θ c hθ hc)
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filter Finsetopen scoped Topology ENNRealnamespace FiniteFactornamespace CouplingParameters
abbrev BlockCoordinate (m : ℕ → ℕ) := Σ s : ℕ, Fin (m s)
end CouplingParametersend FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filter Finsetopen scoped Topology ENNRealnamespace FiniteFactor
def sourceBlockSize (s : ℕ) : ℕ := (sourceStage s).mabbrev SourceCoordinate := CouplingParameters.BlockCoordinate sourceBlockSize
def sourceLogWeight (i : SourceCoordinate) : ℝ := (sourceStage i.1).C
def SourceAngles (θ : SourceCoordinate → ℝ) : Prop := let realGroup : GroupWithZero ℝ := (@DivisionRing.toDivisionSemiring ℝ Real.instField.toDivisionRing).toGroupWithZero let realOrder : LE ℝ := @Preorder.toLE ℝ Real.partialOrder.toPreorder ∀ i : SourceCoordinate, let block : ℝ := @Nat.cast ℝ Real.instNatCast (sourceBlockSize i.1) let cutoff : ℝ := @Nat.cast ℝ Real.instNatCast (sourceStageState i.1).K let denominator : ℝ := @Mul.mul ℝ Real.instMul block cutoff let lower : ℝ := @Div.div ℝ realGroup.toDiv (@One.one ℝ Real.instOne) denominator let upper : ℝ := @Div.div ℝ realGroup.toDiv (@Nat.cast ℝ Real.instNatCast 2) denominator @LE.le ℝ realOrder lower (θ i) ∧ @LE.le ℝ realOrder (θ i) upper
theorem sourceBlockSize_pos (s : ℕ) : (0 : ℝ) < sourceBlockSize s := by exact_mod_cast (show 0 < (sourceStage s).m by have := (sourceStage s).m_ge_100; omega)
theorem sourceCutoff_pos (s : ℕ) : (0 : ℝ) < (sourceStageState s).K := by exact_mod_cast (show 0 < (sourceStageState s).K by have := (sourceStageState s).K_ge; omega)
theorem SourceAngles.nonneg {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) (i : SourceCoordinate) : @LE.le ℝ (@Preorder.toLE ℝ Real.partialOrder.toPreorder) (@Zero.zero ℝ Real.instZero) (θ i) := let realGroup : GroupWithZero ℝ := (@DivisionRing.toDivisionSemiring ℝ Real.instField.toDivisionRing).toGroupWithZero let realOrder : Preorder ℝ := Real.partialOrder.toPreorder let realStrict : @PosMulStrictMono ℝ Real.instMul Real.instZero realOrder := @IsStrictOrderedRing.toPosMulStrictMono ℝ Real.semiring Real.partialOrder Real.instIsStrictOrderedRing let realReflect : @PosMulReflectLT ℝ Real.instMul Real.instZero realOrder := @PosMulMono.toPosMulReflectLT ℝ Real.instMul Real.instZero Real.linearOrder (@IsOrderedRing.toPosMulMono ℝ Real.semiring Real.partialOrder Real.instIsOrderedRing) let block : ℝ := @Nat.cast ℝ Real.instNatCast (sourceBlockSize i.1) let cutoff : ℝ := @Nat.cast ℝ Real.instNatCast (sourceStageState i.1).K let denominator : ℝ := @Mul.mul ℝ Real.instMul block cutoff let lower : ℝ := @Div.div ℝ realGroup.toDiv (@One.one ℝ Real.instOne) denominator let upper : ℝ := @Div.div ℝ realGroup.toDiv (@Nat.cast ℝ Real.instNatCast 2) denominator let zeroReal : ℝ := @Zero.zero ℝ Real.instZero @le_trans ℝ realOrder zeroReal lower (θ i) (@le_of_lt ℝ realOrder zeroReal lower ((@one_div_pos ℝ realGroup Real.partialOrder realReflect denominator).mpr (@mul_pos ℝ realGroup.toMulZeroClass (a := block) (b := cutoff) realOrder realStrict (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1)))) (@And.left (@LE.le ℝ realOrder.toLE lower (θ i)) (@LE.le ℝ realOrder.toLE (θ i) upper) (hθ i))
theorem sourceLogWeight_nonneg (i : SourceCoordinate) : 0 ≤ sourceLogWeight i := le_max_of_le_right (sq_nonneg _)
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filteropen scoped ENNRealnamespace FiniteFactor
def sourceVacuum : SourceHilbert SourceCoordinate := @indicatorConstLp ((SourceCoordinate → ℝ) × ℤ) ℂ (@Prod.instMeasurableSpace (SourceCoordinate → ℝ) ℤ (@MeasurableSpace.pi SourceCoordinate (fun _ => ℝ) (fun _ => Real.measurableSpace)) Int.instMeasurableSpace) (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup (Set.univ ×ˢ {(0 : ℤ)}) (@Nat.cast ENNReal (ENNReal.instAddCommMonoidWithOne.toAddMonoidWithOne.toNatCast) (Nat.succ (Nat.succ Nat.zero))) (MeasurableSet.univ.prod (measurableSet_singleton (0 : ℤ))) (letI : IsProbabilityMeasure unitIntervalMeasure := ⟨(Measure.restrict_apply_univ (μ := (volume : Measure ℝ)) (Set.Ico (0 : ℝ) 1)).trans ((Real.volume_Ico (a := 0) (b := 1)).trans ((congrArg ENNReal.ofReal (sub_zero (1 : ℝ))).trans ENNReal.ofReal_one))⟩ let base : Measure (SourceCoordinate → ℝ) := Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure) let mass_one := (Measure.prod_prod (μ := base) (ν := (Measure.count : Measure ℤ)) Set.univ {(0 : ℤ)}).trans ((congrArg₂ (fun left right : ℝ≥0∞ => left * right) (measure_univ (μ := base)) (Measure.count_singleton (0 : ℤ))).trans (one_mul (1 : ℝ≥0∞))) fun mass_top => ENNReal.one_ne_top (mass_one.symm.trans mass_top)) (1 : ℂ)
theorem sourceVacuum_norm : ‖sourceVacuum‖ = 1 := by rw [sourceVacuum,norm_indicatorConstLp (by norm_num) (by norm_num)] simp [measureReal_def,sourceMeasure,Measure.prod_prod]
section
local notation "vacuumMeasurable" => @Prod.instMeasurableSpace (SourceCoordinate → ℝ) ℤ (@MeasurableSpace.pi SourceCoordinate (fun _ => ℝ) (fun _ => Real.measurableSpace)) Int.instMeasurableSpacelocal notation "vacuumSemiring" => Complex.instNormedField.toField.toCommRing.toRing.toSemiringlocal notation "vacuumIdentity" => @RingHom.id ℂ (@Semiring.toNonAssocSemiring ℂ vacuumSemiring)local notation "vacuumHilbertGroup" => @MeasureTheory.Lp.instNormedAddCommGroup ((SourceCoordinate → ℝ) × ℤ) ℂ vacuumMeasurable (@Nat.cast ENNReal (ENNReal.instAddCommMonoidWithOne.toAddMonoidWithOne.toNatCast) (Nat.succ (Nat.succ Nat.zero))) (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup fact_one_le_two_ennreallocal notation "vacuumHilbertInner" => @MeasureTheory.L2.innerProductSpace ((SourceCoordinate → ℝ) × ℤ) ℂ ℂ Complex.instRCLike vacuumMeasurable (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup (@RCLike.innerProductSpace ℂ Complex.instRCLike)local notation "vacuumHilbertTopology" => @UniformSpace.toTopologicalSpace (SourceHilbert SourceCoordinate) (@PseudoMetricSpace.toUniformSpace (SourceHilbert SourceCoordinate) (@MetricSpace.toPseudoMetricSpace (SourceHilbert SourceCoordinate) (@NormedAddCommGroup.toMetricSpace (SourceHilbert SourceCoordinate) vacuumHilbertGroup)))local notation "vacuumHilbertAddition" => @AddCommGroup.toAddCommMonoid (SourceHilbert SourceCoordinate) (@NormedAddCommGroup.toAddCommGroup (SourceHilbert SourceCoordinate) vacuumHilbertGroup)local notation "vacuumHilbertModule" => @NormedSpace.toModule ℂ (SourceHilbert SourceCoordinate) (@DenselyNormedField.toNormedField ℂ (@RCLike.toDenselyNormedField ℂ Complex.instRCLike)) (@NormedAddCommGroup.toSeminormedAddCommGroup (SourceHilbert SourceCoordinate) vacuumHilbertGroup) (@InnerProductSpace.toNormedSpace ℂ (SourceHilbert SourceCoordinate) Complex.instRCLike (@NormedAddCommGroup.toSeminormedAddCommGroup (SourceHilbert SourceCoordinate) vacuumHilbertGroup) vacuumHilbertInner)
abbrev sourceVacuumFunctional (operator : @ContinuousLinearMap ℂ ℂ vacuumSemiring vacuumSemiring vacuumIdentity (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition vacuumHilbertModule vacuumHilbertModule) : ℂ := @inner ℂ (SourceHilbert SourceCoordinate) (@InnerProductSpace.toInner ℂ (SourceHilbert SourceCoordinate) Complex.instRCLike (@NormedAddCommGroup.toSeminormedAddCommGroup (SourceHilbert SourceCoordinate) vacuumHilbertGroup) vacuumHilbertInner) sourceVacuum (@AddHom.toFun (SourceHilbert SourceCoordinate) (SourceHilbert SourceCoordinate) (vacuumHilbertAddition).toAdd (vacuumHilbertAddition).toAdd (@LinearMap.toAddHom ℂ ℂ vacuumSemiring vacuumSemiring vacuumIdentity (SourceHilbert SourceCoordinate) (SourceHilbert SourceCoordinate) vacuumHilbertAddition vacuumHilbertAddition vacuumHilbertModule vacuumHilbertModule (@ContinuousLinearMap.toLinearMap ℂ ℂ vacuumSemiring vacuumSemiring vacuumIdentity (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition vacuumHilbertModule vacuumHilbertModule operator)) sourceVacuum)
end
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filter InnerProductSpaceopen scoped ComplexInnerProductSpace Topology ENNReal CStarAlgebranamespace FiniteFactor
local instance : IsometricContinuousFunctionalCalculus ℝ (SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) IsSelfAdjoint := IsSelfAdjoint.instIsometricContinuousFunctionalCalculusinstance productHilbertNontrivial : Nontrivial (SourceHilbert SourceCoordinate) := by have hv : sourceVacuum≠0 := by intro hz have h := sourceVacuum_norm rw [hz,norm_zero] at h norm_num at h exact ⟨⟨sourceVacuum,0,hv⟩⟩
end FiniteFactorendend
sectionnoncomputable sectionopen MeasureTheory Filter InnerProductSpaceopen scoped ComplexInnerProductSpace Topologynamespace FiniteFactor
local notation "productMeasurable" => @Prod.instMeasurableSpace (SourceCoordinate → ℝ) ℤ (@MeasurableSpace.pi SourceCoordinate (fun _ => ℝ) (fun _ => Real.measurableSpace)) Int.instMeasurableSpacelocal notation "productSemiring" => Complex.instNormedField.toField.toCommRing.toRing.toSemiringlocal notation "productIdentity" => @RingHom.id ℂ (@Semiring.toNonAssocSemiring ℂ productSemiring)local notation "productExponent" => @Nat.cast ENNReal (ENNReal.instAddCommMonoidWithOne.toAddMonoidWithOne.toNatCast) (Nat.succ (Nat.succ Nat.zero))local notation "productHilbertGroup" => @MeasureTheory.Lp.instNormedAddCommGroup ((SourceCoordinate → ℝ) × ℤ) ℂ productMeasurable productExponent (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup fact_one_le_two_ennreallocal notation "productHilbertInner" => @MeasureTheory.L2.innerProductSpace ((SourceCoordinate → ℝ) × ℤ) ℂ ℂ Complex.instRCLike productMeasurable (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup (@RCLike.innerProductSpace ℂ Complex.instRCLike)local notation "productHilbertTopology" => @UniformSpace.toTopologicalSpace (SourceHilbert SourceCoordinate) (@PseudoMetricSpace.toUniformSpace (SourceHilbert SourceCoordinate) (@MetricSpace.toPseudoMetricSpace (SourceHilbert SourceCoordinate) (@NormedAddCommGroup.toMetricSpace (SourceHilbert SourceCoordinate) productHilbertGroup)))local notation "productHilbertAddition" => @AddCommGroup.toAddCommMonoid (SourceHilbert SourceCoordinate) (@NormedAddCommGroup.toAddCommGroup (SourceHilbert SourceCoordinate) productHilbertGroup)local notation "productHilbertModule" => @NormedSpace.toModule ℂ (SourceHilbert SourceCoordinate) (@DenselyNormedField.toNormedField ℂ (@RCLike.toDenselyNormedField ℂ Complex.instRCLike)) (@NormedAddCommGroup.toSeminormedAddCommGroup (SourceHilbert SourceCoordinate) productHilbertGroup) (@InnerProductSpace.toNormedSpace ℂ (SourceHilbert SourceCoordinate) Complex.instRCLike (@NormedAddCommGroup.toSeminormedAddCommGroup (SourceHilbert SourceCoordinate) productHilbertGroup) productHilbertInner)
abbrev ProductOp := @ContinuousLinearMap ℂ ℂ productSemiring productSemiring productIdentity (SourceHilbert SourceCoordinate) productHilbertTopology productHilbertAddition (SourceHilbert SourceCoordinate) productHilbertTopology productHilbertAddition productHilbertModule productHilbertModule
sectionopen MeasureTheory Filter InnerProductSpaceopen scoped ComplexInnerProductSpace Topology ENNReal
local instance : Module ℝ ProductOp := Module.complexToReal ProductOplocal instance : IsometricContinuousFunctionalCalculus ℝ ProductOp IsSelfAdjoint := IsSelfAdjoint.instIsometricContinuousFunctionalCalculus
def logarithmCutoff (n : ℕ) : C(ℝ,ℝ) where toFun t := Real.log (max (Real.exp (-(n:ℝ))) t) continuous_toFun := (continuous_const.max continuous_id).log (fun _=>ne_of_gt ((Real.exp_pos _).trans_le (le_max_left _ _)))
run_cmd Lean.modifyEnv fun env => Lean.Meta.auxLemmasExt.setState env {}
def FugledeKadisonDeterminant (τ : ProductOp → ℂ) (T : ProductOp) : ℝ≥0∞ := let determinant := fun (Hilbert : Type) [NormedAddCommGroup Hilbert] [InnerProductSpace ℂ Hilbert] [CompleteSpace Hilbert] [Nontrivial Hilbert] (trace : (Hilbert →L[ℂ] Hilbert) → ℂ) (operator : Hilbert →L[ℂ] Hilbert) => letI : Module ℝ (Hilbert →L[ℂ] Hilbert) := Module.complexToReal _ letI : IsometricContinuousFunctionalCalculus ℝ (Hilbert →L[ℂ] Hilbert) IsSelfAdjoint := IsSelfAdjoint.instIsometricContinuousFunctionalCalculus ⨅ n : ℕ, ENNReal.ofReal (Real.exp ((trace (cfc (logarithmCutoff n) (CFC.abs operator))).re)) let domain := (SourceCoordinate → ℝ) × ℤ let measurable : MeasurableSpace domain := productMeasurable let exponent : ℝ≥0∞ := productExponent let measure : @Measure domain measurable := sourceMeasure SourceCoordinate let complete := @MeasureTheory.Lp.instCompleteSpace domain measurable exponent measure ℂ Complex.instNormedAddCommGroup Complex.instCompleteSpace fact_one_le_two_ennreal @determinant (SourceHilbert SourceCoordinate) productHilbertGroup productHilbertInner complete productHilbertNontrivial τ T
end
sectionopen MeasureTheory Filteropen scoped ENNReal Topology
def expLogPotential (μ : Measure ℂ) (z : ℂ) : ℝ≥0∞ := ⨅ n : ℕ, ENNReal.ofReal (Real.exp (∫ w,logarithmCutoff n ‖z-w‖ ∂μ))
def IsBrownMeasure (τ : ProductOp → ℂ) (T : ProductOp) (μ : Measure ℂ) : Prop := let translate := fun (Hilbert : Type) [NormedAddCommGroup Hilbert] [NormedSpace ℂ Hilbert] (operator : Hilbert →L[ℂ] Hilbert) (scalar : ℂ) => operator - algebraMap ℂ (Hilbert →L[ℂ] Hilbert) scalar IsProbabilityMeasure μ ∧ IsCompact μ.support ∧ ∀ z : ℂ, FugledeKadisonDeterminant τ (@translate (SourceHilbert SourceCoordinate) productHilbertGroup (@InnerProductSpace.toNormedSpace ℂ (SourceHilbert SourceCoordinate) Complex.instRCLike (@NormedAddCommGroup.toSeminormedAddCommGroup (SourceHilbert SourceCoordinate) productHilbertGroup) productHilbertInner) T z) = expLogPotential μ z
def ProductBrownClaim : Prop := ∀ (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ), IsBrownMeasure sourceVacuumFunctional (sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg) (Measure.dirac 0)
end
end FiniteFactorendend
namespace FiniteFactor
/-- The Brown measure of the product weighted shift is the point mass at zero. -/theorem productBrown : ProductBrownClaim := by sorry
end FiniteFactor
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.ProjectionCounterexample", "solution_module": "OAI.Geometry.ProjectionBody.Counterexample", "theorem_names": [ "OAI.ProjectionCounterexample.universal_simplex_upper_bound_false" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445import Mathlib.Analysis.Convex.Hullimport Mathlib.Analysis.InnerProductSpace.PiL2import Mathlib.Analysis.InnerProductSpace.Projection.Basicimport Mathlib.Geometry.Euclidean.Volume.Measure
namespace OAI
noncomputable section
open Set MeasureTheoryopen scoped RealInnerProductSpace
namespace ProjectionCounterexample
abbrev E (d : ℕ) := EuclideanSpace ℝ (Fin d)
def simplex (d : ℕ) : Set (E d) := convexHull ℝ (insert 0 (range fun i : Fin d => EuclideanSpace.single i (1 : ℝ)))
def IsConvexBody {d : ℕ} (P : Set (E d)) : Prop := IsCompact P ∧ Convex ℝ P ∧ (interior P).Nonempty
def project {d : ℕ} (u : E d) : E d →L[ℝ] E d := (ℝ ∙ u)ᗮ.starProjection
def projectionVolume {d : ℕ} (P : Set (E d)) (u : E d) : ℝ := (Measure.euclideanHausdorffMeasure (d - 1) (project u '' P)).toReal
def projectionBody {d : ℕ} (P : Set (E d)) : Set (E d) := {x | ∀ u : E d, ‖u‖ = 1 → ⟪u, x⟫ ≤ projectionVolume P u}
def bodyVolume {d : ℕ} (P : Set (E d)) : ℝ := (volume P).toReal
def ratio {d : ℕ} (P : Set (E d)) : ℝ := bodyVolume (projectionBody P) / bodyVolume P ^ (d - 1)
theorem universal_simplex_upper_bound_false : ¬ (∀ P : Set (E 20), IsConvexBody P → ratio P ≤ ratio (simplex 20)) := by sorry
end ProjectionCounterexample
end
end OAI1234567891011121314{ "challenge_module": "ComparatorChallenges.ProjectionMoments", "solution_module": "OAI.Probability.ProjectionMoments.Main", "theorem_names": [ "OAI.ProjectionMoments.main" ], "definition_names": [], "permitted_axioms": [ "propext", "Quot.sound", "Classical.choice" ], "enable_nanoda": false}lean/ComparatorChallenges/PartitionConsistency.leanAdded+324
lean/ComparatorChallenges/PartitionPrinciple.jsonAdded+14
lean/ComparatorChallenges/PartitionPrinciple.leanAdded+277
lean/ComparatorChallenges/PattersonFirstMoment.jsonAdded+16
lean/ComparatorChallenges/PattersonFirstMoment.leanAdded+99
lean/ComparatorChallenges/PerceptronFreeEnergy.jsonAdded+14
lean/ComparatorChallenges/PerceptronFreeEnergy.leanAdded+111
lean/ComparatorChallenges/PerfectCompleteness.jsonAdded+14
lean/ComparatorChallenges/PerfectCompleteness.leanAdded+185
lean/ComparatorChallenges/PeriodicGroup.jsonAdded+14
lean/ComparatorChallenges/PeriodicGroup.leanAdded+56
lean/ComparatorChallenges/PeriodicTilingThree.jsonAdded+14
lean/ComparatorChallenges/PeriodicTilingThree.leanAdded+66
lean/ComparatorChallenges/PermanentCubic.jsonAdded+14
lean/ComparatorChallenges/PermanentCubic.leanAdded+42
lean/ComparatorChallenges/PettyProjectionVolume.jsonAdded+14
lean/ComparatorChallenges/PettyProjectionVolume.leanAdded+54
lean/ComparatorChallenges/PiExponent.jsonAdded+14
lean/ComparatorChallenges/PiExponent.leanAdded+19
lean/ComparatorChallenges/PinchedKahler.jsonAdded+16
lean/ComparatorChallenges/PinchedKahler.leanAdded+159
lean/ComparatorChallenges/PinnedDistances.jsonAdded+13
lean/ComparatorChallenges/PinnedDistances.leanAdded+36
lean/ComparatorChallenges/PlanarAndersonSpectrum.jsonAdded+14
lean/ComparatorChallenges/PlanarAndersonSpectrum.leanAdded+35
lean/ComparatorChallenges/PlanarFalconer.jsonAdded+14
lean/ComparatorChallenges/PlanarFalconer.leanAdded+25
lean/ComparatorChallenges/PlanarFirstPassage.jsonAdded+14
lean/ComparatorChallenges/PlanarFirstPassage.leanAdded+102
lean/ComparatorChallenges/PlanarL1.jsonAdded+14
lean/ComparatorChallenges/PlanarL1.leanAdded+51
lean/ComparatorChallenges/PlanarPacking.jsonAdded+14
lean/ComparatorChallenges/PlanarPacking.leanAdded+40
lean/ComparatorChallenges/PlanarUnitDistances.jsonAdded+14
lean/ComparatorChallenges/PlanarUnitDistances.leanAdded+25
lean/ComparatorChallenges/PlaneColoring.jsonAdded+14
lean/ComparatorChallenges/PlaneColoring.leanAdded+21
lean/ComparatorChallenges/PolycyclicRecognition.jsonAdded+16
lean/ComparatorChallenges/PolycyclicRecognition.leanAdded+249
lean/ComparatorChallenges/PosteriorReplicas.jsonAdded+14
lean/ComparatorChallenges/PosteriorReplicas.leanAdded+455
lean/ComparatorChallenges/PowerFreeValues.jsonAdded+14
lean/ComparatorChallenges/PowerFreeValues.leanAdded+46
lean/ComparatorChallenges/PrimeGaps.jsonAdded+14
lean/ComparatorChallenges/PrimeGaps.leanAdded+47
lean/ComparatorChallenges/ProductBrown.jsonAdded+14
lean/ComparatorChallenges/ProductBrown.leanAdded+757
lean/ComparatorChallenges/ProjectionCounterexample.jsonAdded+14
lean/ComparatorChallenges/ProjectionCounterexample.leanAdded+45
lean/ComparatorChallenges/ProjectionMoments.jsonAdded+14