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