1use 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}
61pub fn abelian_variety_ty() -> Expr {
64 arrow(cst("Field"), arrow(nat_ty(), type0()))
65}
66pub fn polarized_abelian_variety_ty() -> Expr {
69 arrow(cst("Field"), arrow(nat_ty(), type0()))
70}
71pub fn tate_module_ty() -> Expr {
74 arrow(
75 cst("AbelianVarietyObj"),
76 arrow(cst("Prime"), cst("ZpModule")),
77 )
78}
79pub fn dual_abelian_variety_ty() -> Expr {
82 arrow(cst("AbelianVarietyObj"), cst("AbelianVarietyObj"))
83}
84pub 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}
99pub 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}
122pub 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}
151pub fn elliptic_curve_ty() -> Expr {
154 arrow(cst("Field"), type0())
155}
156pub fn isogeny_ty() -> Expr {
159 arrow(
160 cst("EllipticCurveObj"),
161 arrow(cst("EllipticCurveObj"), type0()),
162 )
163}
164pub fn torsion_point_ty() -> Expr {
167 arrow(cst("EllipticCurveObj"), arrow(nat_ty(), type0()))
168}
169pub fn height_function_ty() -> Expr {
172 arrow(
173 cst("EllipticCurveObj"),
174 arrow(cst("EllipticPointObj"), real_ty()),
175 )
176}
177pub 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}
196pub 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}
224pub 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}
247pub 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}
262pub fn shimura_datum_ty() -> Expr {
265 arrow(
266 cst("ReductiveGroup"),
267 arrow(cst("HermitianDomain"), type0()),
268 )
269}
270pub fn shimura_variety_ty() -> Expr {
273 arrow(
274 cst("ShimuraDatumObj"),
275 arrow(cst("CompactOpenSubgroup"), type0()),
276 )
277}
278pub fn canonical_model_ty() -> Expr {
281 arrow(
282 cst("ShimuraVarietyObj"),
283 arrow(cst("ReflexField"), cst("AlgebraicVariety")),
284 )
285}
286pub 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}
304pub 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}
324pub fn galois_representation_ty() -> Expr {
327 arrow(
328 cst("GaloisGroup"),
329 arrow(nat_ty(), arrow(cst("Ring"), type0())),
330 )
331}
332pub fn nearly_ordinary_representation_ty() -> Expr {
335 arrow(cst("GaloisGroup"), arrow(cst("Prime"), type0()))
336}
337pub fn automorphic_representation_ty() -> Expr {
340 arrow(cst("ReductiveGroup"), type0())
341}
342pub fn langlands_correspondence_ty() -> Expr {
345 arrow(
346 cst("GaloisRepresentationObj"),
347 arrow(cst("AutomorphicRepresentationObj"), prop()),
348 )
349}
350pub 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}
370pub 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}
385pub 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}
400pub fn absolute_height_ty() -> Expr {
403 arrow(cst("ProjectivePoint"), real_ty())
404}
405pub fn logarithmic_height_ty() -> Expr {
408 arrow(cst("ProjectivePoint"), real_ty())
409}
410pub fn northcott_property_ty() -> Expr {
413 arrow(type0(), prop())
414}
415pub fn faltings_thm_ty() -> Expr {
418 arrow(cst("AlgebraicCurve"), prop())
419}
420pub 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}
439pub 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}
461pub 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}
509pub fn perfectoid_space_ty() -> Expr {
513 type0()
514}
515pub fn diamond_ty() -> Expr {
518 arrow(cst("PerfectoidSpaceObj"), type0())
519}
520pub fn v_stack_ty() -> Expr {
523 arrow(cst("Site"), type0())
524}
525pub 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}
544pub fn prismatic_cohomology_ty() -> Expr {
547 arrow(cst("Scheme"), arrow(cst("Prism"), cst("AbelianGroup")))
548}
549pub 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}
568pub fn syntomic_cohomology_ty() -> Expr {
571 arrow(cst("Scheme"), arrow(nat_ty(), cst("AbelianGroup")))
572}
573pub fn fontaine_theory_ty() -> Expr {
576 arrow(
577 cst("PAdicField"),
578 arrow(cst("GaloisRepresentationObj"), cst("HodgeTateDecomp")),
579 )
580}
581pub 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}
605pub fn condensed_set_ty() -> Expr {
608 type0()
609}
610pub fn solid_abelian_group_ty() -> Expr {
613 arrow(cst("CondensedAbelianGroupObj"), prop())
614}
615pub fn liquid_vector_space_ty() -> Expr {
618 arrow(real_ty(), arrow(cst("CondensedVectorSpaceObj"), prop()))
619}
620pub 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}
634pub 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}
661pub fn motivic_cohomology_ty() -> Expr {
664 arrow(
665 cst("Scheme"),
666 arrow(int_ty(), arrow(int_ty(), cst("AbelianGroup"))),
667 )
668}
669pub fn mixed_motive_ty() -> Expr {
672 arrow(cst("NumberField"), type0())
673}
674pub fn slice_filtration_ty() -> Expr {
677 arrow(cst("MotiveObj"), arrow(nat_ty(), cst("MotiveObj")))
678}
679pub fn a1_homotopy_type_ty() -> Expr {
682 arrow(cst("Scheme"), cst("A1SpaceObj"))
683}
684pub 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}
704pub 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}
721pub 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}
744pub fn berkovich_space_ty() -> Expr {
747 arrow(cst("AffinoidAlgebra"), type0())
748}
749pub fn affinoid_algebra_ty() -> Expr {
752 arrow(cst("NonArchField"), type0())
753}
754pub fn adic_space_ty() -> Expr {
757 arrow(cst("HuberRing"), type0())
758}
759pub fn rigid_analytic_space_ty() -> Expr {
762 arrow(cst("NonArchField"), type0())
763}
764pub 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}
787pub 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}
802pub fn pro_etale_topos_ty() -> Expr {
805 arrow(cst("Scheme"), cst("Topos"))
806}
807pub 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}
827pub fn log_scheme_ty() -> Expr {
830 arrow(cst("Scheme"), arrow(cst("LogStructure"), type0()))
831}
832pub fn log_etale_cohomology_ty() -> Expr {
835 arrow(cst("LogSchemeObj"), arrow(nat_ty(), cst("AbelianGroup")))
836}
837pub fn log_crystalline_cohomology_ty() -> Expr {
840 arrow(cst("LogSchemeObj"), arrow(cst("Ring"), cst("AbelianGroup")))
841}
842pub fn neron_model_ty() -> Expr {
845 arrow(
846 cst("AbelianVarietyObj"),
847 arrow(cst("DVRing"), cst("GroupScheme")),
848 )
849}
850pub 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}
881pub 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}
904pub fn faltings_height_ty() -> Expr {
907 arrow(cst("AbelianVarietyObj"), real_ty())
908}
909pub 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}
934pub fn crystalline_cohomology_ty() -> Expr {
937 arrow(cst("Scheme"), arrow(cst("Ring"), cst("AbelianGroup")))
938}
939pub 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}
956pub 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}
1372pub fn weierstrass_discriminant(a: i64, b: i64) -> i64 {
1374 -16 * (4 * a.pow(3) + 27 * b.pow(2))
1375}
1376pub 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}
1384pub 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}
1393pub fn rank_lower_bound_2descent(_a: i64, _b: i64) -> usize {
1397 0
1398}