Skip to main content

oxilean_std/arithmetic_geometry/
functions.rs

1//! Auto-generated module
2//!
3//! πŸ€– Generated with [SplitRS](https://github.com/cool-japan/splitrs)
4
5use oxilean_kernel::Node;
6use oxilean_kernel::{BinderInfo, Declaration, Environment, Expr, Level, Name};
7
8use super::types::{
9    AbelianVariety, AbsoluteHeight, AutomorphicRepresentation, BerkovichSpace, CanonicalModel,
10    ChowGroup, DualAbelianVariety, EllipticCurve, FaltingsThm, GaloisRepresentation,
11    HeightFunction, Isogeny, LanglandsCorrespondence, LogarithmicHeight,
12    NearlyOrdinaryRepresentation, NeronModel, NorthcottProperty, PolarizedAbelianVariety,
13    ShimuraDatum, ShimuraVariety, TateModule, TolimaniConjecture, TorsionPoint,
14};
15
16pub fn app(f: Expr, a: Expr) -> Expr {
17    Expr::App(Node::new(f), Node::new(a))
18}
19pub fn app2(f: Expr, a: Expr, b: Expr) -> Expr {
20    app(app(f, a), b)
21}
22pub fn app3(f: Expr, a: Expr, b: Expr, c: Expr) -> Expr {
23    app(app2(f, a, b), c)
24}
25pub fn cst(s: &str) -> Expr {
26    Expr::Const(Name::str(s), vec![])
27}
28pub fn prop() -> Expr {
29    Expr::Sort(Level::zero())
30}
31pub fn type0() -> Expr {
32    Expr::Sort(Level::succ(Level::zero()))
33}
34pub fn type1() -> Expr {
35    Expr::Sort(Level::succ(Level::succ(Level::zero())))
36}
37pub fn pi(bi: BinderInfo, name: &str, dom: Expr, body: Expr) -> Expr {
38    Expr::Pi(bi, Name::str(name), Node::new(dom), Node::new(body))
39}
40pub fn arrow(a: Expr, b: Expr) -> Expr {
41    pi(BinderInfo::Default, "_", a, b)
42}
43pub fn bvar(n: u32) -> Expr {
44    Expr::BVar(n)
45}
46pub fn nat_ty() -> Expr {
47    cst("Nat")
48}
49pub fn int_ty() -> Expr {
50    cst("Int")
51}
52pub fn real_ty() -> Expr {
53    cst("Real")
54}
55pub fn bool_ty() -> Expr {
56    cst("Bool")
57}
58pub fn list_ty(elem: Expr) -> Expr {
59    app(cst("List"), elem)
60}
61/// `AbelianVariety : Field β†’ Nat β†’ Type`
62/// An abelian variety over a field k of dimension g is a smooth projective group variety.
63pub fn abelian_variety_ty() -> Expr {
64    arrow(cst("Field"), arrow(nat_ty(), type0()))
65}
66/// `PolarizedAbelianVariety : Field β†’ Nat β†’ Type`
67/// An abelian variety together with an ample line bundle (polarization).
68pub fn polarized_abelian_variety_ty() -> Expr {
69    arrow(cst("Field"), arrow(nat_ty(), type0()))
70}
71/// `TateModule : AbelianVarietyObj β†’ Prime β†’ ZpModule`
72/// T_p(A) = lim_{n} A[p^n], the p-adic Tate module of A, free of rank 2g over β„€_p.
73pub fn tate_module_ty() -> Expr {
74    arrow(
75        cst("AbelianVarietyObj"),
76        arrow(cst("Prime"), cst("ZpModule")),
77    )
78}
79/// `DualAbelianVariety : AbelianVarietyObj β†’ AbelianVarietyObj`
80/// A^ = Pic^0(A), the dual abelian variety (variety of degree-0 line bundles).
81pub fn dual_abelian_variety_ty() -> Expr {
82    arrow(cst("AbelianVarietyObj"), cst("AbelianVarietyObj"))
83}
84/// PoincarΓ© reducibility: every abelian variety is isogenous to a product of simple abelian varieties.
85///
86/// `βˆ€ (A : AbelianVarietyObj), βˆƒ (simples : List AbelianVarietyObj), IsogenousToProduct A simples`
87pub fn poincare_reducibility_ty() -> Expr {
88    pi(
89        BinderInfo::Default,
90        "A",
91        cst("AbelianVarietyObj"),
92        app2(
93            cst("Exists"),
94            list_ty(cst("AbelianVarietyObj")),
95            app2(cst("IsogenousToProduct"), bvar(1), bvar(0)),
96        ),
97    )
98}
99/// Tate module rank theorem.
100///
101/// `βˆ€ (A : AbelianVarietyObj) (p : Prime), Rank (TateModule A p) = 2 * Dimension A`
102pub fn tate_module_rank_ty() -> Expr {
103    pi(
104        BinderInfo::Default,
105        "A",
106        cst("AbelianVarietyObj"),
107        pi(
108            BinderInfo::Default,
109            "p",
110            cst("Prime"),
111            app2(
112                cst("NatEq"),
113                app(
114                    cst("ZpModuleRank"),
115                    app2(cst("TateModule"), bvar(1), bvar(0)),
116                ),
117                app(cst("NatMul2"), app(cst("AbelianVarietyDim"), bvar(1))),
118            ),
119        ),
120    )
121}
122/// Isogeny theorem: for abelian varieties over finite fields, Hom(A, B) βŠ— β„€_β„“ β‰… Hom(T_β„“ A, T_β„“ B).
123///
124/// `βˆ€ (A B : AbelianVarietyObj) (ell : Prime), IsFiniteField k β†’
125///    Iso (HomTensor A B ell) (TateModuleHom A B ell)`
126pub fn isogeny_theorem_ty() -> Expr {
127    pi(
128        BinderInfo::Default,
129        "A",
130        cst("AbelianVarietyObj"),
131        pi(
132            BinderInfo::Default,
133            "B",
134            cst("AbelianVarietyObj"),
135            pi(
136                BinderInfo::Default,
137                "ell",
138                cst("Prime"),
139                arrow(
140                    cst("IsFiniteField"),
141                    app2(
142                        cst("Iso"),
143                        app3(cst("HomTensor"), bvar(2), bvar(1), bvar(0)),
144                        app3(cst("TateModuleHom"), bvar(2), bvar(1), bvar(0)),
145                    ),
146                ),
147            ),
148        ),
149    )
150}
151/// `EllipticCurve : Field β†’ Type`
152/// An elliptic curve E/k given by a Weierstrass equation yΒ² = xΒ³ + ax + b.
153pub fn elliptic_curve_ty() -> Expr {
154    arrow(cst("Field"), type0())
155}
156/// `Isogeny : EllipticCurveObj β†’ EllipticCurveObj β†’ Type`
157/// A group homomorphism Ο†: E β†’ E' with finite kernel.
158pub fn isogeny_ty() -> Expr {
159    arrow(
160        cst("EllipticCurveObj"),
161        arrow(cst("EllipticCurveObj"), type0()),
162    )
163}
164/// `TorsionPoint : EllipticCurveObj β†’ Nat β†’ Type`
165/// E\[n\] = {P ∈ E : nP = O}, the n-torsion subgroup.
166pub fn torsion_point_ty() -> Expr {
167    arrow(cst("EllipticCurveObj"), arrow(nat_ty(), type0()))
168}
169/// `HeightFunction : EllipticCurveObj β†’ EllipticPointObj β†’ Real`
170/// The canonical NΓ©ron-Tate height Δ₯: E(KΜ„) β†’ ℝ.
171pub fn height_function_ty() -> Expr {
172    arrow(
173        cst("EllipticCurveObj"),
174        arrow(cst("EllipticPointObj"), real_ty()),
175    )
176}
177/// Mordell-Weil theorem: E(K) is a finitely generated abelian group.
178///
179/// `βˆ€ (E : EllipticCurveObj) (K : NumberField), IsFinitelyGenerated (EllipticPoints E K)`
180pub fn mordell_weil_ty() -> Expr {
181    pi(
182        BinderInfo::Default,
183        "E",
184        cst("EllipticCurveObj"),
185        pi(
186            BinderInfo::Default,
187            "K",
188            cst("NumberField"),
189            app(
190                cst("IsFinitelyGenerated"),
191                app2(cst("EllipticPoints"), bvar(1), bvar(0)),
192            ),
193        ),
194    )
195}
196/// Torsion structure: E\[n\] β‰… (β„€/nβ„€)Β² over an algebraically closed field of characteristic 0.
197///
198/// `βˆ€ (E : EllipticCurveObj) (n : Nat), IsAlgClosedChar0 k β†’
199///    Iso (TorsionPoint E n) (DirectSum (ZMod n) (ZMod n))`
200pub fn torsion_structure_ty() -> Expr {
201    pi(
202        BinderInfo::Default,
203        "E",
204        cst("EllipticCurveObj"),
205        pi(
206            BinderInfo::Default,
207            "n",
208            nat_ty(),
209            arrow(
210                cst("IsAlgClosedChar0"),
211                app2(
212                    cst("Iso"),
213                    app2(cst("TorsionPoint"), bvar(1), bvar(0)),
214                    app2(
215                        cst("DirectSum"),
216                        app(cst("ZMod"), bvar(1)),
217                        app(cst("ZMod"), bvar(1)),
218                    ),
219                ),
220            ),
221        ),
222    )
223}
224/// Weil pairing: E\[n\] Γ— E^\[n\] β†’ ΞΌ_n (alternating, non-degenerate).
225///
226/// `βˆ€ (E : EllipticCurveObj) (n : Nat), WeilPairing E n : TorsionPoint E n Γ— TorsionPoint E^ n β†’ RootsUnity n`
227pub fn weil_pairing_ty() -> Expr {
228    pi(
229        BinderInfo::Default,
230        "E",
231        cst("EllipticCurveObj"),
232        pi(
233            BinderInfo::Default,
234            "n",
235            nat_ty(),
236            arrow(
237                app2(
238                    cst("ProductGroup"),
239                    app2(cst("TorsionPoint"), bvar(1), bvar(0)),
240                    app2(cst("TorsionPoint"), app(cst("DualEC"), bvar(1)), bvar(0)),
241                ),
242                app(cst("RootsUnityGroup"), bvar(0)),
243            ),
244        ),
245    )
246}
247/// BSD conjecture data: rank of E(β„š) equals order of vanishing of L(E, s) at s=1.
248///
249/// `βˆ€ (E : EllipticCurveObj), ord_{s=1} L(E, s) = rank E(Q)`
250pub fn bsd_conjecture_ty() -> Expr {
251    pi(
252        BinderInfo::Default,
253        "E",
254        cst("EllipticCurveObj"),
255        app2(
256            cst("NatEq"),
257            app(cst("LFunctionOrder"), bvar(0)),
258            app(cst("MordellWeilRank"), bvar(0)),
259        ),
260    )
261}
262/// `ShimuraDatum : ReductiveGroup β†’ HermitianDomain β†’ Type`
263/// A Shimura datum (G, X) where G is a reductive group and X a hermitian symmetric domain.
264pub fn shimura_datum_ty() -> Expr {
265    arrow(
266        cst("ReductiveGroup"),
267        arrow(cst("HermitianDomain"), type0()),
268    )
269}
270/// `ShimuraVariety : ShimuraDatumObj β†’ CompactOpenSubgroup β†’ Type`
271/// Sh_K(G, X) = G(β„š) \ X Γ— G(𝔸_f) / K, a moduli space of abelian varieties with extra structure.
272pub fn shimura_variety_ty() -> Expr {
273    arrow(
274        cst("ShimuraDatumObj"),
275        arrow(cst("CompactOpenSubgroup"), type0()),
276    )
277}
278/// `CanonicalModel : ShimuraVarietyObj β†’ ReflexField β†’ AlgebraicVariety`
279/// The canonical model of a Shimura variety over its reflex field E(G, X).
280pub fn canonical_model_ty() -> Expr {
281    arrow(
282        cst("ShimuraVarietyObj"),
283        arrow(cst("ReflexField"), cst("AlgebraicVariety")),
284    )
285}
286/// `TolimaniConjecture : ShimuraVarietyObj β†’ Prop`
287/// The AndrΓ©-Oort conjecture: special subvarieties are Zariski closures of special points.
288pub fn andre_oort_conjecture_ty() -> Expr {
289    pi(
290        BinderInfo::Default,
291        "Sh",
292        cst("ShimuraVarietyObj"),
293        pi(
294            BinderInfo::Default,
295            "Z",
296            app(cst("IrreducibleSubvariety"), bvar(0)),
297            arrow(
298                app2(cst("IsZariskiClosureSpecialPoints"), bvar(1), bvar(0)),
299                app2(cst("IsSpecialSubvariety"), bvar(1), bvar(0)),
300            ),
301        ),
302    )
303}
304/// Reciprocity law for Shimura varieties: Frobenius acts on special points via the reflex norm.
305///
306/// `βˆ€ (Sh : ShimuraVarietyObj) (x : SpecialPoint Sh), FrobeniusAction Sh x = ReflexNormOf x`
307pub fn shimura_reciprocity_ty() -> Expr {
308    pi(
309        BinderInfo::Default,
310        "Sh",
311        cst("ShimuraVarietyObj"),
312        pi(
313            BinderInfo::Default,
314            "x",
315            app(cst("SpecialPoint"), bvar(0)),
316            app2(
317                cst("PointEq"),
318                app2(cst("FrobeniusAction"), bvar(1), bvar(0)),
319                app(cst("ReflexNormOf"), bvar(0)),
320            ),
321        ),
322    )
323}
324/// `GaloisRepresentation : GaloisGroup β†’ Nat β†’ Ring β†’ Type`
325/// A continuous homomorphism ρ: G_K β†’ GL_n(R).
326pub fn galois_representation_ty() -> Expr {
327    arrow(
328        cst("GaloisGroup"),
329        arrow(nat_ty(), arrow(cst("Ring"), type0())),
330    )
331}
332/// `NearlyOrdinaryRepresentation : GaloisGroup β†’ Prime β†’ Type`
333/// A p-adic Galois representation admitting a Borel reduction at p (ordinary at p).
334pub fn nearly_ordinary_representation_ty() -> Expr {
335    arrow(cst("GaloisGroup"), arrow(cst("Prime"), type0()))
336}
337/// `AutomorphicRepresentation : ReductiveGroup β†’ Type`
338/// An automorphic representation Ο€ = βŠ—_v Ο€_v of a reductive group G over a number field.
339pub fn automorphic_representation_ty() -> Expr {
340    arrow(cst("ReductiveGroup"), type0())
341}
342/// `LanglandsCorrespondence : GaloisRepresentationObj β†’ AutomorphicRepresentationObj β†’ Prop`
343/// The local/global Langlands correspondence: ρ_Ο€ ↔ Ο€.
344pub fn langlands_correspondence_ty() -> Expr {
345    arrow(
346        cst("GaloisRepresentationObj"),
347        arrow(cst("AutomorphicRepresentationObj"), prop()),
348    )
349}
350/// Local Langlands correspondence for GL_n.
351///
352/// `βˆ€ (K : LocalField) (n : Nat), Bijection (GaloisReps K n) (AutomorphicReps (GL n K))`
353pub fn local_langlands_gl_n_ty() -> Expr {
354    pi(
355        BinderInfo::Default,
356        "K",
357        cst("LocalField"),
358        pi(
359            BinderInfo::Default,
360            "n",
361            nat_ty(),
362            app2(
363                cst("Bijection"),
364                app2(cst("GaloisReps"), bvar(1), bvar(0)),
365                app(cst("AutomorphicReps"), app2(cst("GL"), bvar(0), bvar(1))),
366            ),
367        ),
368    )
369}
370/// Global Langlands conjecture: correspondence between automorphic forms and Galois representations.
371///
372/// `βˆ€ (Ο€ : AutomorphicRepresentationObj), βˆƒ (ρ : GaloisRepresentationObj), IsAssociated ρ Ο€`
373pub fn global_langlands_ty() -> Expr {
374    pi(
375        BinderInfo::Default,
376        "pi_rep",
377        cst("AutomorphicRepresentationObj"),
378        app2(
379            cst("Exists"),
380            cst("GaloisRepresentationObj"),
381            app2(cst("IsAssociated"), bvar(0), bvar(1)),
382        ),
383    )
384}
385/// Sato-Tate conjecture: for a non-CM elliptic curve E/β„š, the distribution of
386/// a_p / 2√p is equidistributed with respect to the Sato-Tate measure on \[-1, 1\].
387///
388/// `βˆ€ (E : EllipticCurveObj), IsNonCM E β†’ SatoTateEquidistributed E`
389pub fn sato_tate_ty() -> Expr {
390    pi(
391        BinderInfo::Default,
392        "E",
393        cst("EllipticCurveObj"),
394        arrow(
395            app(cst("IsNonCM"), bvar(0)),
396            app(cst("SatoTateEquidistributed"), bvar(0)),
397        ),
398    )
399}
400/// `AbsoluteHeight : ProjectivePoint β†’ Real`
401/// H(P) = max|x_i|_v, the absolute Weil height on projective space.
402pub fn absolute_height_ty() -> Expr {
403    arrow(cst("ProjectivePoint"), real_ty())
404}
405/// `LogarithmicHeight : ProjectivePoint β†’ Real`
406/// h(P) = log H(P), the logarithmic Weil height.
407pub fn logarithmic_height_ty() -> Expr {
408    arrow(cst("ProjectivePoint"), real_ty())
409}
410/// `NorthcottProperty : Type β†’ Prop`
411/// A set S has the Northcott property if for all B, {P ∈ S : H(P) ≀ B} is finite.
412pub fn northcott_property_ty() -> Expr {
413    arrow(type0(), prop())
414}
415/// `FaltingsThm : AlgebraicCurve β†’ Prop`
416/// Faltings's theorem (Mordell conjecture): a curve of genus β‰₯ 2 over β„š has finitely many rational points.
417pub fn faltings_thm_ty() -> Expr {
418    arrow(cst("AlgebraicCurve"), prop())
419}
420/// Northcott property for projective space.
421///
422/// `βˆ€ (n : Nat) (B : Real), Finite {P : P^n(Q) | H(P) ≀ B}`
423pub fn northcott_projective_ty() -> Expr {
424    pi(
425        BinderInfo::Default,
426        "n",
427        nat_ty(),
428        pi(
429            BinderInfo::Default,
430            "B",
431            real_ty(),
432            app(
433                cst("IsFinite"),
434                app2(cst("ProjectivePointsBoundedHeight"), bvar(1), bvar(0)),
435            ),
436        ),
437    )
438}
439/// Faltings's theorem (Mordell conjecture, proved by Faltings 1983).
440///
441/// `βˆ€ (C : AlgebraicCurve) (K : NumberField), Genus C β‰₯ 2 β†’ IsFinite (RationalPoints C K)`
442pub fn faltings_mordell_ty() -> Expr {
443    pi(
444        BinderInfo::Default,
445        "C",
446        cst("AlgebraicCurve"),
447        pi(
448            BinderInfo::Default,
449            "K",
450            cst("NumberField"),
451            arrow(
452                app(cst("GeqTwo"), app(cst("CurveGenus"), bvar(1))),
453                app(
454                    cst("IsFinite"),
455                    app2(cst("RationalPoints"), bvar(1), bvar(0)),
456                ),
457            ),
458        ),
459    )
460}
461/// NΓ©ron-Tate height satisfies the parallelogram law.
462///
463/// `βˆ€ (E : EllipticCurveObj) (P Q : EllipticPointObj),
464///    Δ₯(P + Q) + Δ₯(P - Q) = 2 Δ₯(P) + 2 Δ₯(Q)`
465pub fn neron_tate_parallelogram_ty() -> Expr {
466    pi(
467        BinderInfo::Default,
468        "E",
469        cst("EllipticCurveObj"),
470        pi(
471            BinderInfo::Default,
472            "P",
473            cst("EllipticPointObj"),
474            pi(
475                BinderInfo::Default,
476                "Q",
477                cst("EllipticPointObj"),
478                app2(
479                    cst("RealEq"),
480                    app2(
481                        cst("Real.add"),
482                        app(
483                            cst("NeronTateHeight"),
484                            app3(cst("EllipticAdd"), bvar(2), bvar(1), bvar(0)),
485                        ),
486                        app(
487                            cst("NeronTateHeight"),
488                            app3(cst("EllipticSub"), bvar(2), bvar(1), bvar(0)),
489                        ),
490                    ),
491                    app2(
492                        cst("Real.add"),
493                        app2(
494                            cst("Real.mul"),
495                            cst("Two"),
496                            app(cst("NeronTateHeight"), bvar(1)),
497                        ),
498                        app2(
499                            cst("Real.mul"),
500                            cst("Two"),
501                            app(cst("NeronTateHeight"), bvar(0)),
502                        ),
503                    ),
504                ),
505            ),
506        ),
507    )
508}
509/// `PerfectoidSpace : Type`
510/// A perfectoid space is a topological space with a perfectoid algebra structure,
511/// used to transfer problems between characteristic 0 and characteristic p.
512pub fn perfectoid_space_ty() -> Expr {
513    type0()
514}
515/// `Diamond : PerfectoidSpaceObj β†’ Type`
516/// X^β—‡ = X / (Frobenius equivalence), the diamond associated to a perfectoid space.
517pub fn diamond_ty() -> Expr {
518    arrow(cst("PerfectoidSpaceObj"), type0())
519}
520/// `VStack : Site β†’ Type`
521/// A v-stack (sheaf on the v-topology), generalizing perfectoid spaces and diamonds.
522pub fn v_stack_ty() -> Expr {
523    arrow(cst("Site"), type0())
524}
525/// Tilting equivalence: there is an equivalence between perfectoid spaces of characteristic 0
526/// and characteristic p via the tilt functor X ↦ X^β™­.
527///
528/// `βˆ€ (X : PerfectoidSpaceObj), IsPerfectoid X β†’ IsEquiv (TiltFunctor X) (TiltedSpace X)`
529pub fn tilting_equivalence_ty() -> Expr {
530    pi(
531        BinderInfo::Default,
532        "X",
533        cst("PerfectoidSpaceObj"),
534        arrow(
535            app(cst("IsPerfectoid"), bvar(0)),
536            app2(
537                cst("IsEquiv"),
538                app(cst("TiltFunctor"), bvar(0)),
539                app(cst("TiltedSpace"), bvar(0)),
540            ),
541        ),
542    )
543}
544/// `PrismaticCohomology : Scheme β†’ Prism β†’ AbelianGroup`
545/// The prismatic cohomology H^*_{Ξ”}(X/A) of a p-adic formal scheme X over a prism (A, I).
546pub fn prismatic_cohomology_ty() -> Expr {
547    arrow(cst("Scheme"), arrow(cst("Prism"), cst("AbelianGroup")))
548}
549/// Prismatic comparison: prismatic cohomology specializes to de Rham, Γ©tale, and crystalline cohomology.
550///
551/// `βˆ€ (X : Scheme) (A : Prism), PrismaticSpec X A β†’ CohomologyComparisonTriangle X A`
552pub fn prismatic_comparison_ty() -> Expr {
553    pi(
554        BinderInfo::Default,
555        "X",
556        cst("Scheme"),
557        pi(
558            BinderInfo::Default,
559            "A",
560            cst("Prism"),
561            arrow(
562                app2(cst("PrismaticSpec"), bvar(1), bvar(0)),
563                app2(cst("CohomologyComparisonTriangle"), bvar(1), bvar(0)),
564            ),
565        ),
566    )
567}
568/// `Syntomic Cohomology : Scheme β†’ Nat β†’ AbelianGroup`
569/// Syntomic cohomology H^i_{syn}(X, Z_p(n)), interpolating between crystalline and Γ©tale.
570pub fn syntomic_cohomology_ty() -> Expr {
571    arrow(cst("Scheme"), arrow(nat_ty(), cst("AbelianGroup")))
572}
573/// `FontaineTheory : PAdicField β†’ GaloisRepresentationObj β†’ HodgeTateDecomp`
574/// Fontaine's theory associates a Hodge-Tate decomposition to a de Rham Galois representation.
575pub fn fontaine_theory_ty() -> Expr {
576    arrow(
577        cst("PAdicField"),
578        arrow(cst("GaloisRepresentationObj"), cst("HodgeTateDecomp")),
579    )
580}
581/// Fontaine's C_dR βŠ— D_dR(V) β‰… C_dR βŠ— V: de Rham comparison for p-adic representations.
582///
583/// `βˆ€ (K : PAdicField) (V : GaloisRepresentationObj), IsDeRham V β†’
584///    Iso (TensorCdR (DdRModule V)) (TensorCdR V)`
585pub fn fontaine_de_rham_comparison_ty() -> Expr {
586    pi(
587        BinderInfo::Default,
588        "K",
589        cst("PAdicField"),
590        pi(
591            BinderInfo::Default,
592            "V",
593            cst("GaloisRepresentationObj"),
594            arrow(
595                app(cst("IsDeRham"), bvar(0)),
596                app2(
597                    cst("Iso"),
598                    app(cst("TensorCdR"), app(cst("DdRModule"), bvar(0))),
599                    app(cst("TensorCdR"), bvar(0)),
600                ),
601            ),
602        ),
603    )
604}
605/// `CondensedSet : Type`
606/// A condensed set is a sheaf of sets on the category of profinite sets (Clausen-Scholze).
607pub fn condensed_set_ty() -> Expr {
608    type0()
609}
610/// `SolidAbelianGroup : CondensedAbelianGroupObj β†’ Prop`
611/// A condensed abelian group is solid if it satisfies the solid module condition (Clausen-Scholze).
612pub fn solid_abelian_group_ty() -> Expr {
613    arrow(cst("CondensedAbelianGroupObj"), prop())
614}
615/// `LiquidVectorSpace : Real β†’ CondensedVectorSpaceObj β†’ Prop`
616/// A p-liquid vector space V is a condensed vector space satisfying the p-liquid condition.
617pub fn liquid_vector_space_ty() -> Expr {
618    arrow(real_ty(), arrow(cst("CondensedVectorSpaceObj"), prop()))
619}
620/// Analytic ring structure: every solid abelian group admits a natural analytic ring structure.
621///
622/// `βˆ€ (G : CondensedAbelianGroupObj), IsSolid G β†’ ExistsAnalyticRingStr G`
623pub fn analytic_ring_structure_ty() -> Expr {
624    pi(
625        BinderInfo::Default,
626        "G",
627        cst("CondensedAbelianGroupObj"),
628        arrow(
629            app(cst("IsSolid"), bvar(0)),
630            app(cst("ExistsAnalyticRingStr"), bvar(0)),
631        ),
632    )
633}
634/// Liquid tensor product: the p-liquid tensor product is exact for 0 < p ≀ 1.
635///
636/// `βˆ€ (p : Real) (V W : CondensedVectorSpaceObj), IsPLiquid p V β†’ IsExact (LiquidTensor p V W)`
637pub fn liquid_tensor_exact_ty() -> Expr {
638    pi(
639        BinderInfo::Default,
640        "p",
641        real_ty(),
642        pi(
643            BinderInfo::Default,
644            "V",
645            cst("CondensedVectorSpaceObj"),
646            pi(
647                BinderInfo::Default,
648                "W",
649                cst("CondensedVectorSpaceObj"),
650                arrow(
651                    app2(cst("IsPLiquid"), bvar(2), bvar(1)),
652                    app(
653                        cst("IsExact"),
654                        app3(cst("LiquidTensor"), bvar(2), bvar(1), bvar(0)),
655                    ),
656                ),
657            ),
658        ),
659    )
660}
661/// `MotivicCohomology : Scheme β†’ Int β†’ Int β†’ AbelianGroup`
662/// Motivic cohomology H^{p,q}(X, Z), the bigraded cohomology theory of algebraic varieties.
663pub fn motivic_cohomology_ty() -> Expr {
664    arrow(
665        cst("Scheme"),
666        arrow(int_ty(), arrow(int_ty(), cst("AbelianGroup"))),
667    )
668}
669/// `MixedMotive : NumberField β†’ Type`
670/// A mixed motive over a number field K: an object in Voevodsky's triangulated category of motives.
671pub fn mixed_motive_ty() -> Expr {
672    arrow(cst("NumberField"), type0())
673}
674/// `SliceFiltration : MotiveObj β†’ Nat β†’ MotiveObj`
675/// Voevodsky's slice filtration s_n(M): the n-th slice of a motive M.
676pub fn slice_filtration_ty() -> Expr {
677    arrow(cst("MotiveObj"), arrow(nat_ty(), cst("MotiveObj")))
678}
679/// `A1HomotopyType : Scheme β†’ A1SpaceObj`
680/// The AΒΉ-homotopy type Sing^{AΒΉ}(X) of an algebraic variety X.
681pub fn a1_homotopy_type_ty() -> Expr {
682    arrow(cst("Scheme"), cst("A1SpaceObj"))
683}
684/// Motivic cohomology comparison: H^{2n,n}(X, Z) β‰… CH^n(X) (Chow groups).
685///
686/// `βˆ€ (X : Scheme) (n : Nat), Iso (MotivicCohomology X (2*n) n) (ChowGroup X n)`
687pub fn motivic_chow_comparison_ty() -> Expr {
688    pi(
689        BinderInfo::Default,
690        "X",
691        cst("Scheme"),
692        pi(
693            BinderInfo::Default,
694            "n",
695            nat_ty(),
696            app2(
697                cst("Iso"),
698                app3(cst("MotivicCohomologyGrp"), bvar(1), bvar(0), bvar(0)),
699                app2(cst("ChowGroup"), bvar(1), bvar(0)),
700            ),
701        ),
702    )
703}
704/// Beilinson-Lichtenbaum conjecture (proved): motivic cohomology agrees with Γ©tale cohomology
705/// in the range p ≀ q (mod n).
706///
707/// `βˆ€ (X : Scheme) (n : Nat), BeilinsonLichtenbaumIso X n`
708pub fn beilinson_lichtenbaum_ty() -> Expr {
709    pi(
710        BinderInfo::Default,
711        "X",
712        cst("Scheme"),
713        pi(
714            BinderInfo::Default,
715            "n",
716            nat_ty(),
717            app2(cst("BeilinsonLichtenbaumIso"), bvar(1), bvar(0)),
718        ),
719    )
720}
721/// Voevodsky's cancellation theorem: βŠ— AΒΉ is invertible in the motivic stable homotopy category.
722///
723/// `βˆ€ (M N : MotiveObj), Iso (TwistedMotive M) (TwistedMotive N) β†’ Iso M N`
724pub fn voevodsky_cancellation_ty() -> Expr {
725    pi(
726        BinderInfo::Default,
727        "M",
728        cst("MotiveObj"),
729        pi(
730            BinderInfo::Default,
731            "N",
732            cst("MotiveObj"),
733            arrow(
734                app2(
735                    cst("Iso"),
736                    app(cst("TwistedMotive"), bvar(1)),
737                    app(cst("TwistedMotive"), bvar(0)),
738                ),
739                app2(cst("Iso"), bvar(1), bvar(0)),
740            ),
741        ),
742    )
743}
744/// `BerkovichSpace : AffinoidAlgebra β†’ Type`
745/// The Berkovich space M(A) of an affinoid algebra A: the space of bounded multiplicative seminorms.
746pub fn berkovich_space_ty() -> Expr {
747    arrow(cst("AffinoidAlgebra"), type0())
748}
749/// `AffinoidAlgebra : NonArchField β†’ Type`
750/// An affinoid algebra T_n/I over a non-archimedean field K.
751pub fn affinoid_algebra_ty() -> Expr {
752    arrow(cst("NonArchField"), type0())
753}
754/// `AdicSpace : HuberRing β†’ Type`
755/// An adic space Spa(A, A+) for a Huber ring A, generalizing rigid analytic spaces.
756pub fn adic_space_ty() -> Expr {
757    arrow(cst("HuberRing"), type0())
758}
759/// `RigidAnalyticSpace : NonArchField β†’ Type`
760/// A rigid analytic space (Tate, 1971) over a non-archimedean field.
761pub fn rigid_analytic_space_ty() -> Expr {
762    arrow(cst("NonArchField"), type0())
763}
764/// GAGA for rigid analytic spaces: coherent analytic sheaves correspond to algebraic coherent sheaves.
765///
766/// `βˆ€ (X : ProjectiveScheme) (K : NonArchField), Equiv (AlgCohSheaves X) (AnCohSheaves (Analytify X K))`
767pub fn rigid_gaga_ty() -> Expr {
768    pi(
769        BinderInfo::Default,
770        "X",
771        cst("ProjectiveScheme"),
772        pi(
773            BinderInfo::Default,
774            "K",
775            cst("NonArchField"),
776            app2(
777                cst("Equiv"),
778                app(cst("AlgCohSheaves"), bvar(1)),
779                app(
780                    cst("AnCohSheaves"),
781                    app2(cst("Analytify"), bvar(1), bvar(0)),
782                ),
783            ),
784        ),
785    )
786}
787/// Berkovich analytification is a retract onto the skeleton.
788///
789/// `βˆ€ (X : BerkovichSpaceObj), βˆƒ (S : Skeleton X), IsDeformRetract X S`
790pub fn berkovich_skeleton_retract_ty() -> Expr {
791    pi(
792        BinderInfo::Default,
793        "X",
794        cst("BerkovichSpaceObj"),
795        app2(
796            cst("Exists"),
797            app(cst("Skeleton"), bvar(0)),
798            app2(cst("IsDeformRetract"), bvar(1), bvar(0)),
799        ),
800    )
801}
802/// `ProEtaleTopos : Scheme β†’ Topos`
803/// The pro-Γ©tale topos X_{pro-Γ©t} of a scheme X (Bhatt-Scholze).
804pub fn pro_etale_topos_ty() -> Expr {
805    arrow(cst("Scheme"), cst("Topos"))
806}
807/// Pro-Γ©tale cohomology: the pro-Γ©tale cohomology of X with coefficients in Z_β„“.
808///
809/// `βˆ€ (X : Scheme) (ell : Prime), Iso (ProEtCohomology X ell) (EtCohomology X ell)`
810pub fn pro_etale_comparison_ty() -> Expr {
811    pi(
812        BinderInfo::Default,
813        "X",
814        cst("Scheme"),
815        pi(
816            BinderInfo::Default,
817            "ell",
818            cst("Prime"),
819            app2(
820                cst("Iso"),
821                app2(cst("ProEtCohomology"), bvar(1), bvar(0)),
822                app2(cst("EtCohomology"), bvar(1), bvar(0)),
823            ),
824        ),
825    )
826}
827/// `LogScheme : Scheme β†’ LogStructure β†’ Type`
828/// A log scheme (X, M_X) where M_X is a sheaf of monoids on X (Fontaine-Illusie-Kato).
829pub fn log_scheme_ty() -> Expr {
830    arrow(cst("Scheme"), arrow(cst("LogStructure"), type0()))
831}
832/// `LogEtaleCohomology : LogSchemeObj β†’ Nat β†’ AbelianGroup`
833/// Log-Γ©tale cohomology H^i_{log-et}(X, Z/nZ) of a log scheme X.
834pub fn log_etale_cohomology_ty() -> Expr {
835    arrow(cst("LogSchemeObj"), arrow(nat_ty(), cst("AbelianGroup")))
836}
837/// `LogCrystallineCohomology : LogSchemeObj β†’ Ring β†’ AbelianGroup`
838/// Log-crystalline cohomology H^i_{log-cris}(X/W) with W the Witt vectors.
839pub fn log_crystalline_cohomology_ty() -> Expr {
840    arrow(cst("LogSchemeObj"), arrow(cst("Ring"), cst("AbelianGroup")))
841}
842/// `NeronModel : AbelianVarietyObj β†’ DVRing β†’ GroupScheme`
843/// The NΓ©ron model N(A) of an abelian variety A over the fraction field of a DVR.
844pub fn neron_model_ty() -> Expr {
845    arrow(
846        cst("AbelianVarietyObj"),
847        arrow(cst("DVRing"), cst("GroupScheme")),
848    )
849}
850/// NΓ©ron mapping property: every rational map from a smooth scheme to A extends to N(A).
851///
852/// `βˆ€ (A : AbelianVarietyObj) (R : DVRing) (S : SmoothSchemeObj),
853///    βˆ€ (f : RationalMap S A), UniqueExtension (NeronModel A R) f`
854pub fn neron_mapping_property_ty() -> Expr {
855    pi(
856        BinderInfo::Default,
857        "A",
858        cst("AbelianVarietyObj"),
859        pi(
860            BinderInfo::Default,
861            "R",
862            cst("DVRing"),
863            pi(
864                BinderInfo::Default,
865                "S",
866                cst("SmoothSchemeObj"),
867                pi(
868                    BinderInfo::Default,
869                    "f",
870                    app2(cst("RationalMap"), bvar(0), bvar(2)),
871                    app2(
872                        cst("UniqueExtension"),
873                        app2(cst("NeronModel"), bvar(3), bvar(2)),
874                        bvar(0),
875                    ),
876                ),
877            ),
878        ),
879    )
880}
881/// Semi-stable reduction theorem: after a finite base change, any abelian variety becomes semi-stable.
882///
883/// `βˆ€ (A : AbelianVarietyObj) (K : NumberField), βˆƒ (L : NumberField), IsSemiStable (BaseChange A L)`
884pub fn semi_stable_reduction_ty() -> Expr {
885    pi(
886        BinderInfo::Default,
887        "A",
888        cst("AbelianVarietyObj"),
889        pi(
890            BinderInfo::Default,
891            "K",
892            cst("NumberField"),
893            app2(
894                cst("Exists"),
895                cst("NumberField"),
896                app(
897                    cst("IsSemiStable"),
898                    app2(cst("BaseChange"), bvar(1), bvar(0)),
899                ),
900            ),
901        ),
902    )
903}
904/// `FaltingsHeight : AbelianVarietyObj β†’ Real`
905/// The Faltings height h_F(A) of a principally polarized abelian variety A.
906pub fn faltings_height_ty() -> Expr {
907    arrow(cst("AbelianVarietyObj"), real_ty())
908}
909/// Northcott for Faltings heights: there are finitely many isomorphism classes of
910/// principally polarized abelian varieties over K with bounded Faltings height and fixed dimension.
911///
912/// `βˆ€ (g : Nat) (K : NumberField) (B : Real), IsFinite (PPAVBoundedFaltingsHeight g K B)`
913pub fn northcott_faltings_height_ty() -> Expr {
914    pi(
915        BinderInfo::Default,
916        "g",
917        nat_ty(),
918        pi(
919            BinderInfo::Default,
920            "K",
921            cst("NumberField"),
922            pi(
923                BinderInfo::Default,
924                "B",
925                real_ty(),
926                app(
927                    cst("IsFinite"),
928                    app3(cst("PPAVBoundedFaltingsHeight"), bvar(2), bvar(1), bvar(0)),
929                ),
930            ),
931        ),
932    )
933}
934/// `CrystallineCohomology : Scheme β†’ Ring β†’ AbelianGroup`
935/// Crystalline cohomology H^i_{cris}(X/W) of a smooth proper variety in characteristic p.
936pub fn crystalline_cohomology_ty() -> Expr {
937    arrow(cst("Scheme"), arrow(cst("Ring"), cst("AbelianGroup")))
938}
939/// Crystalline comparison theorem (Berthelot-Ogus): for a smooth proper scheme over W(k),
940/// H^i_{cris}(X_k/W(k)) β‰… H^i_{dR}(X/W(k)).
941///
942/// `βˆ€ (X : SmoothProperScheme) (k : PerfectField), CrystallineDeRhamIso X k`
943pub fn crystalline_de_rham_iso_ty() -> Expr {
944    pi(
945        BinderInfo::Default,
946        "X",
947        cst("SmoothProperScheme"),
948        pi(
949            BinderInfo::Default,
950            "k",
951            cst("PerfectField"),
952            app2(cst("CrystallineDeRhamIso"), bvar(1), bvar(0)),
953        ),
954    )
955}
956/// Register all arithmetic geometry axioms and theorem types in the environment.
957pub fn build_env(env: &mut Environment) {
958    let base_types: &[(&str, Expr)] = &[
959        ("Field", type0()),
960        ("NumberField", type0()),
961        ("LocalField", type0()),
962        ("FiniteField", type0()),
963        ("Ring", type0()),
964        ("Prime", nat_ty()),
965        ("Real", type0()),
966        ("AlgebraicVariety", type0()),
967        ("AlgebraicCurve", type0()),
968        ("ProjectivePoint", type0()),
969        ("EllipticPointObj", type0()),
970        ("AbelianVarietyObj", type0()),
971        ("EllipticCurveObj", type0()),
972        ("ShimuraDatumObj", type0()),
973        ("ShimuraVarietyObj", type0()),
974        ("GaloisRepresentationObj", type0()),
975        ("AutomorphicRepresentationObj", type0()),
976        ("ReductiveGroup", type0()),
977        ("HermitianDomain", type0()),
978        ("CompactOpenSubgroup", type0()),
979        ("ReflexField", type0()),
980        ("GaloisGroup", type0()),
981        ("ZpModule", type0()),
982        (
983            "TateModule",
984            arrow(
985                cst("AbelianVarietyObj"),
986                arrow(cst("Prime"), cst("ZpModule")),
987            ),
988        ),
989        (
990            "DualAbelianVariety",
991            arrow(cst("AbelianVarietyObj"), cst("AbelianVarietyObj")),
992        ),
993        (
994            "AbelianVarietyDim",
995            arrow(cst("AbelianVarietyObj"), nat_ty()),
996        ),
997        ("ZpModuleRank", arrow(cst("ZpModule"), nat_ty())),
998        ("NatMul2", arrow(nat_ty(), nat_ty())),
999        ("NatEq", arrow(nat_ty(), arrow(nat_ty(), prop()))),
1000        ("Iso", arrow(type0(), arrow(type0(), prop()))),
1001        ("And", arrow(prop(), arrow(prop(), prop()))),
1002        ("Exists", arrow(type0(), arrow(type0(), prop()))),
1003        ("IsFinitelyGenerated", arrow(type0(), prop())),
1004        ("IsFinite", arrow(type0(), prop())),
1005        (
1006            "IsogenyMap",
1007            arrow(
1008                cst("EllipticCurveObj"),
1009                arrow(cst("EllipticCurveObj"), type0()),
1010            ),
1011        ),
1012        (
1013            "TorsionPoint",
1014            arrow(cst("EllipticCurveObj"), arrow(nat_ty(), type0())),
1015        ),
1016        (
1017            "EllipticPoints",
1018            arrow(cst("EllipticCurveObj"), arrow(cst("NumberField"), type0())),
1019        ),
1020        (
1021            "IsogenousToProduct",
1022            arrow(
1023                cst("AbelianVarietyObj"),
1024                arrow(list_ty(cst("AbelianVarietyObj")), prop()),
1025            ),
1026        ),
1027        (
1028            "HomTensor",
1029            arrow(
1030                cst("AbelianVarietyObj"),
1031                arrow(cst("AbelianVarietyObj"), arrow(cst("Prime"), type0())),
1032            ),
1033        ),
1034        (
1035            "TateModuleHom",
1036            arrow(
1037                cst("AbelianVarietyObj"),
1038                arrow(cst("AbelianVarietyObj"), arrow(cst("Prime"), type0())),
1039            ),
1040        ),
1041        ("IsFiniteField", prop()),
1042        ("ZMod", arrow(nat_ty(), type0())),
1043        ("DirectSum", arrow(type0(), arrow(type0(), type0()))),
1044        ("IsAlgClosedChar0", prop()),
1045        (
1046            "DualEC",
1047            arrow(cst("EllipticCurveObj"), cst("EllipticCurveObj")),
1048        ),
1049        ("ProductGroup", arrow(type0(), arrow(type0(), type0()))),
1050        ("RootsUnityGroup", arrow(nat_ty(), type0())),
1051        ("LFunctionOrder", arrow(cst("EllipticCurveObj"), nat_ty())),
1052        ("MordellWeilRank", arrow(cst("EllipticCurveObj"), nat_ty())),
1053        ("Bijection", arrow(type0(), arrow(type0(), prop()))),
1054        ("GL", arrow(nat_ty(), arrow(cst("LocalField"), type0()))),
1055        (
1056            "GaloisReps",
1057            arrow(cst("LocalField"), arrow(nat_ty(), type0())),
1058        ),
1059        ("AutomorphicReps", arrow(type0(), type0())),
1060        (
1061            "IsAssociated",
1062            arrow(
1063                cst("GaloisRepresentationObj"),
1064                arrow(cst("AutomorphicRepresentationObj"), prop()),
1065            ),
1066        ),
1067        ("IsNonCM", arrow(cst("EllipticCurveObj"), prop())),
1068        (
1069            "SatoTateEquidistributed",
1070            arrow(cst("EllipticCurveObj"), prop()),
1071        ),
1072        (
1073            "IrreducibleSubvariety",
1074            arrow(cst("ShimuraVarietyObj"), type0()),
1075        ),
1076        (
1077            "IsZariskiClosureSpecialPoints",
1078            arrow(cst("ShimuraVarietyObj"), arrow(type0(), prop())),
1079        ),
1080        (
1081            "IsSpecialSubvariety",
1082            arrow(cst("ShimuraVarietyObj"), arrow(type0(), prop())),
1083        ),
1084        ("SpecialPoint", arrow(cst("ShimuraVarietyObj"), type0())),
1085        ("PointEq", arrow(type0(), arrow(type0(), prop()))),
1086        (
1087            "FrobeniusAction",
1088            arrow(cst("ShimuraVarietyObj"), arrow(type0(), type0())),
1089        ),
1090        ("ReflexNormOf", arrow(type0(), type0())),
1091        (
1092            "ProjectivePointsBoundedHeight",
1093            arrow(nat_ty(), arrow(real_ty(), type0())),
1094        ),
1095        ("CurveGenus", arrow(cst("AlgebraicCurve"), nat_ty())),
1096        ("GeqTwo", arrow(nat_ty(), prop())),
1097        (
1098            "RationalPoints",
1099            arrow(cst("AlgebraicCurve"), arrow(cst("NumberField"), type0())),
1100        ),
1101        ("NeronTateHeight", arrow(cst("EllipticPointObj"), real_ty())),
1102        ("RealEq", arrow(real_ty(), arrow(real_ty(), prop()))),
1103        ("Real.add", arrow(real_ty(), arrow(real_ty(), real_ty()))),
1104        ("Real.mul", arrow(real_ty(), arrow(real_ty(), real_ty()))),
1105        ("Two", real_ty()),
1106        (
1107            "EllipticAdd",
1108            arrow(
1109                cst("EllipticCurveObj"),
1110                arrow(
1111                    cst("EllipticPointObj"),
1112                    arrow(cst("EllipticPointObj"), cst("EllipticPointObj")),
1113                ),
1114            ),
1115        ),
1116        (
1117            "EllipticSub",
1118            arrow(
1119                cst("EllipticCurveObj"),
1120                arrow(
1121                    cst("EllipticPointObj"),
1122                    arrow(cst("EllipticPointObj"), cst("EllipticPointObj")),
1123                ),
1124            ),
1125        ),
1126        ("Spec", arrow(cst("Field"), type0())),
1127        (
1128            "LongExactSeq",
1129            arrow(type0(), arrow(type0(), arrow(type0(), prop()))),
1130        ),
1131        ("PerfectoidSpaceObj", type0()),
1132        ("Prism", type0()),
1133        ("PAdicField", type0()),
1134        ("AbelianGroup", type0()),
1135        ("HodgeTateDecomp", type0()),
1136        ("Site", type0()),
1137        ("IsPerfectoid", arrow(cst("PerfectoidSpaceObj"), prop())),
1138        ("TiltFunctor", arrow(cst("PerfectoidSpaceObj"), type0())),
1139        ("TiltedSpace", arrow(cst("PerfectoidSpaceObj"), type0())),
1140        ("IsEquiv", arrow(type0(), arrow(type0(), prop()))),
1141        (
1142            "PrismaticSpec",
1143            arrow(cst("Scheme"), arrow(cst("Prism"), prop())),
1144        ),
1145        (
1146            "CohomologyComparisonTriangle",
1147            arrow(cst("Scheme"), arrow(cst("Prism"), prop())),
1148        ),
1149        ("IsDeRham", arrow(cst("GaloisRepresentationObj"), prop())),
1150        ("TensorCdR", arrow(type0(), type0())),
1151        ("DdRModule", arrow(cst("GaloisRepresentationObj"), type0())),
1152        ("CondensedAbelianGroupObj", type0()),
1153        ("CondensedVectorSpaceObj", type0()),
1154        ("IsSolid", arrow(cst("CondensedAbelianGroupObj"), prop())),
1155        (
1156            "ExistsAnalyticRingStr",
1157            arrow(cst("CondensedAbelianGroupObj"), prop()),
1158        ),
1159        (
1160            "IsPLiquid",
1161            arrow(real_ty(), arrow(cst("CondensedVectorSpaceObj"), prop())),
1162        ),
1163        ("IsExact", arrow(type0(), prop())),
1164        (
1165            "LiquidTensor",
1166            arrow(
1167                real_ty(),
1168                arrow(
1169                    cst("CondensedVectorSpaceObj"),
1170                    arrow(cst("CondensedVectorSpaceObj"), type0()),
1171                ),
1172            ),
1173        ),
1174        ("Scheme", type0()),
1175        ("MotiveObj", type0()),
1176        ("A1SpaceObj", type0()),
1177        (
1178            "MotivicCohomologyGrp",
1179            arrow(
1180                cst("Scheme"),
1181                arrow(nat_ty(), arrow(nat_ty(), cst("AbelianGroup"))),
1182            ),
1183        ),
1184        ("ChowGroup", arrow(cst("Scheme"), arrow(nat_ty(), type0()))),
1185        (
1186            "BeilinsonLichtenbaumIso",
1187            arrow(cst("Scheme"), arrow(nat_ty(), prop())),
1188        ),
1189        ("TwistedMotive", arrow(cst("MotiveObj"), cst("MotiveObj"))),
1190        ("AffinoidAlgebra", type0()),
1191        ("NonArchField", type0()),
1192        ("HuberRing", type0()),
1193        ("Topos", type0()),
1194        ("ProjectiveScheme", type0()),
1195        ("BerkovichSpaceObj", type0()),
1196        ("AlgCohSheaves", arrow(cst("ProjectiveScheme"), type0())),
1197        ("AnCohSheaves", arrow(type0(), type0())),
1198        (
1199            "Analytify",
1200            arrow(cst("ProjectiveScheme"), arrow(cst("NonArchField"), type0())),
1201        ),
1202        ("Equiv", arrow(type0(), arrow(type0(), prop()))),
1203        ("Skeleton", arrow(cst("BerkovichSpaceObj"), type0())),
1204        (
1205            "IsDeformRetract",
1206            arrow(cst("BerkovichSpaceObj"), arrow(type0(), prop())),
1207        ),
1208        (
1209            "ProEtCohomology",
1210            arrow(cst("Scheme"), arrow(cst("Prime"), type0())),
1211        ),
1212        (
1213            "EtCohomology",
1214            arrow(cst("Scheme"), arrow(cst("Prime"), type0())),
1215        ),
1216        ("LogStructure", type0()),
1217        ("LogSchemeObj", type0()),
1218        ("DVRing", type0()),
1219        ("GroupScheme", type0()),
1220        ("SmoothSchemeObj", type0()),
1221        ("SmoothProperScheme", type0()),
1222        ("PerfectField", type0()),
1223        (
1224            "RationalMap",
1225            arrow(
1226                cst("SmoothSchemeObj"),
1227                arrow(cst("AbelianVarietyObj"), type0()),
1228            ),
1229        ),
1230        (
1231            "UniqueExtension",
1232            arrow(cst("GroupScheme"), arrow(type0(), prop())),
1233        ),
1234        (
1235            "NeronModel",
1236            arrow(
1237                cst("AbelianVarietyObj"),
1238                arrow(cst("DVRing"), cst("GroupScheme")),
1239            ),
1240        ),
1241        ("IsSemiStable", arrow(type0(), prop())),
1242        (
1243            "BaseChange",
1244            arrow(cst("AbelianVarietyObj"), arrow(cst("NumberField"), type0())),
1245        ),
1246        (
1247            "PPAVBoundedFaltingsHeight",
1248            arrow(
1249                nat_ty(),
1250                arrow(cst("NumberField"), arrow(real_ty(), type0())),
1251            ),
1252        ),
1253        (
1254            "CrystallineDeRhamIso",
1255            arrow(
1256                cst("SmoothProperScheme"),
1257                arrow(cst("PerfectField"), prop()),
1258            ),
1259        ),
1260    ];
1261    for (name, ty) in base_types {
1262        env.add(Declaration::Axiom {
1263            name: Name::str(*name),
1264            univ_params: vec![],
1265            ty: ty.clone(),
1266        })
1267        .ok();
1268    }
1269    let type_axioms: &[(&str, fn() -> Expr)] = &[
1270        ("AbelianVarietyType", abelian_variety_ty),
1271        ("PolarizedAbelianVarietyType", polarized_abelian_variety_ty),
1272        ("TateModuleType", tate_module_ty),
1273        ("DualAbelianVarietyType", dual_abelian_variety_ty),
1274        ("EllipticCurveType", elliptic_curve_ty),
1275        ("IsogenyType", isogeny_ty),
1276        ("TorsionPointType", torsion_point_ty),
1277        ("HeightFunctionType", height_function_ty),
1278        ("ShimuraDatumType", shimura_datum_ty),
1279        ("ShimuraVarietyType", shimura_variety_ty),
1280        ("CanonicalModelType", canonical_model_ty),
1281        ("GaloisRepresentationType", galois_representation_ty),
1282        ("NearlyOrdinaryRepType", nearly_ordinary_representation_ty),
1283        (
1284            "AutomorphicRepresentationType",
1285            automorphic_representation_ty,
1286        ),
1287        ("LanglandsCorrespondenceType", langlands_correspondence_ty),
1288        ("AbsoluteHeightType", absolute_height_ty),
1289        ("LogarithmicHeightType", logarithmic_height_ty),
1290        ("NorthcottPropertyType", northcott_property_ty),
1291        ("FaltingsThmType", faltings_thm_ty),
1292        ("PerfectoidSpaceType", perfectoid_space_ty),
1293        ("DiamondType", diamond_ty),
1294        ("VStackType", v_stack_ty),
1295        ("PrismaticCohomologyType", prismatic_cohomology_ty),
1296        ("SyntomicCohomologyType", syntomic_cohomology_ty),
1297        ("FontaineTheoryType", fontaine_theory_ty),
1298        ("CondensedSetType", condensed_set_ty),
1299        ("SolidAbelianGroupType", solid_abelian_group_ty),
1300        ("LiquidVectorSpaceType", liquid_vector_space_ty),
1301        ("MotivicCohomologyType", motivic_cohomology_ty),
1302        ("MixedMotiveType", mixed_motive_ty),
1303        ("SliceFiltrationType", slice_filtration_ty),
1304        ("A1HomotopyTypeType", a1_homotopy_type_ty),
1305        ("BerkovichSpaceType", berkovich_space_ty),
1306        ("AffinoidAlgebraType", affinoid_algebra_ty),
1307        ("AdicSpaceType", adic_space_ty),
1308        ("RigidAnalyticSpaceType", rigid_analytic_space_ty),
1309        ("ProEtaleToposType", pro_etale_topos_ty),
1310        ("LogSchemeType", log_scheme_ty),
1311        ("LogEtaleCohomologyType", log_etale_cohomology_ty),
1312        (
1313            "LogCrystallineCohomologyType",
1314            log_crystalline_cohomology_ty,
1315        ),
1316        ("NeronModelType", neron_model_ty),
1317        ("FaltingsHeightType", faltings_height_ty),
1318        ("CrystallineCohomologyType", crystalline_cohomology_ty),
1319    ];
1320    for (name, mk_ty) in type_axioms {
1321        env.add(Declaration::Axiom {
1322            name: Name::str(*name),
1323            univ_params: vec![],
1324            ty: mk_ty(),
1325        })
1326        .ok();
1327    }
1328    let theorem_axioms: &[(&str, fn() -> Expr)] = &[
1329        ("poincare_reducibility", poincare_reducibility_ty),
1330        ("tate_module_rank", tate_module_rank_ty),
1331        ("isogeny_theorem", isogeny_theorem_ty),
1332        ("mordell_weil", mordell_weil_ty),
1333        ("torsion_structure", torsion_structure_ty),
1334        ("weil_pairing", weil_pairing_ty),
1335        ("bsd_conjecture", bsd_conjecture_ty),
1336        ("andre_oort_conjecture", andre_oort_conjecture_ty),
1337        ("shimura_reciprocity", shimura_reciprocity_ty),
1338        ("local_langlands_gl_n", local_langlands_gl_n_ty),
1339        ("global_langlands", global_langlands_ty),
1340        ("sato_tate", sato_tate_ty),
1341        ("northcott_projective", northcott_projective_ty),
1342        ("faltings_mordell", faltings_mordell_ty),
1343        ("neron_tate_parallelogram", neron_tate_parallelogram_ty),
1344        ("tilting_equivalence", tilting_equivalence_ty),
1345        ("prismatic_comparison", prismatic_comparison_ty),
1346        (
1347            "fontaine_de_rham_comparison",
1348            fontaine_de_rham_comparison_ty,
1349        ),
1350        ("analytic_ring_structure", analytic_ring_structure_ty),
1351        ("liquid_tensor_exact", liquid_tensor_exact_ty),
1352        ("motivic_chow_comparison", motivic_chow_comparison_ty),
1353        ("beilinson_lichtenbaum", beilinson_lichtenbaum_ty),
1354        ("voevodsky_cancellation", voevodsky_cancellation_ty),
1355        ("rigid_gaga", rigid_gaga_ty),
1356        ("berkovich_skeleton_retract", berkovich_skeleton_retract_ty),
1357        ("pro_etale_comparison", pro_etale_comparison_ty),
1358        ("neron_mapping_property", neron_mapping_property_ty),
1359        ("semi_stable_reduction", semi_stable_reduction_ty),
1360        ("northcott_faltings_height", northcott_faltings_height_ty),
1361        ("crystalline_de_rham_iso", crystalline_de_rham_iso_ty),
1362    ];
1363    for (name, mk_ty) in theorem_axioms {
1364        env.add(Declaration::Axiom {
1365            name: Name::str(*name),
1366            univ_params: vec![],
1367            ty: mk_ty(),
1368        })
1369        .ok();
1370    }
1371}
1372/// Discriminant of a Weierstrass cubic yΒ² = xΒ³ + ax + b.
1373pub fn weierstrass_discriminant(a: i64, b: i64) -> i64 {
1374    -16 * (4 * a.pow(3) + 27 * b.pow(2))
1375}
1376/// j-invariant of yΒ² = xΒ³ + ax + b (returns None if singular).
1377pub fn j_invariant(a: i64, b: i64) -> Option<f64> {
1378    let delta = weierstrass_discriminant(a, b);
1379    if delta == 0 {
1380        return None;
1381    }
1382    Some(-1728.0 * (4.0 * a as f64).powi(3) / (delta as f64))
1383}
1384/// Estimate the number of rational points on E(𝔽_q) using Hasse's bound.
1385///
1386/// |#E(𝔽_q) - (q + 1)| ≀ 2√q.
1387/// Returns (lower bound, upper bound).
1388pub fn hasse_bound(q: u64) -> (i64, i64) {
1389    let two_sqrt_q = 2.0 * (q as f64).sqrt();
1390    let center = (q as i64) + 1;
1391    (center - two_sqrt_q as i64, center + two_sqrt_q as i64)
1392}
1393/// Compute the rank of an elliptic curve E/β„š via naive 2-descent lower bound.
1394///
1395/// This is a placeholder returning 0; full 2-descent requires more data.
1396pub fn rank_lower_bound_2descent(_a: i64, _b: i64) -> usize {
1397    0
1398}