1use 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}
60pub fn abelian_variety_ty() -> Expr {
63 arrow(cst("Field"), arrow(nat_ty(), type0()))
64}
65pub fn polarized_abelian_variety_ty() -> Expr {
68 arrow(cst("Field"), arrow(nat_ty(), type0()))
69}
70pub fn tate_module_ty() -> Expr {
73 arrow(
74 cst("AbelianVarietyObj"),
75 arrow(cst("Prime"), cst("ZpModule")),
76 )
77}
78pub fn dual_abelian_variety_ty() -> Expr {
81 arrow(cst("AbelianVarietyObj"), cst("AbelianVarietyObj"))
82}
83pub 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}
98pub 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}
121pub 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}
150pub fn elliptic_curve_ty() -> Expr {
153 arrow(cst("Field"), type0())
154}
155pub fn isogeny_ty() -> Expr {
158 arrow(
159 cst("EllipticCurveObj"),
160 arrow(cst("EllipticCurveObj"), type0()),
161 )
162}
163pub fn torsion_point_ty() -> Expr {
166 arrow(cst("EllipticCurveObj"), arrow(nat_ty(), type0()))
167}
168pub fn height_function_ty() -> Expr {
171 arrow(
172 cst("EllipticCurveObj"),
173 arrow(cst("EllipticPointObj"), real_ty()),
174 )
175}
176pub 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}
195pub 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}
223pub 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}
246pub 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}
261pub fn shimura_datum_ty() -> Expr {
264 arrow(
265 cst("ReductiveGroup"),
266 arrow(cst("HermitianDomain"), type0()),
267 )
268}
269pub fn shimura_variety_ty() -> Expr {
272 arrow(
273 cst("ShimuraDatumObj"),
274 arrow(cst("CompactOpenSubgroup"), type0()),
275 )
276}
277pub fn canonical_model_ty() -> Expr {
280 arrow(
281 cst("ShimuraVarietyObj"),
282 arrow(cst("ReflexField"), cst("AlgebraicVariety")),
283 )
284}
285pub 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}
303pub 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}
323pub fn galois_representation_ty() -> Expr {
326 arrow(
327 cst("GaloisGroup"),
328 arrow(nat_ty(), arrow(cst("Ring"), type0())),
329 )
330}
331pub fn nearly_ordinary_representation_ty() -> Expr {
334 arrow(cst("GaloisGroup"), arrow(cst("Prime"), type0()))
335}
336pub fn automorphic_representation_ty() -> Expr {
339 arrow(cst("ReductiveGroup"), type0())
340}
341pub fn langlands_correspondence_ty() -> Expr {
344 arrow(
345 cst("GaloisRepresentationObj"),
346 arrow(cst("AutomorphicRepresentationObj"), prop()),
347 )
348}
349pub 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}
369pub 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}
384pub 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}
399pub fn absolute_height_ty() -> Expr {
402 arrow(cst("ProjectivePoint"), real_ty())
403}
404pub fn logarithmic_height_ty() -> Expr {
407 arrow(cst("ProjectivePoint"), real_ty())
408}
409pub fn northcott_property_ty() -> Expr {
412 arrow(type0(), prop())
413}
414pub fn faltings_thm_ty() -> Expr {
417 arrow(cst("AlgebraicCurve"), prop())
418}
419pub 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}
438pub 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}
460pub 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}
508pub fn perfectoid_space_ty() -> Expr {
512 type0()
513}
514pub fn diamond_ty() -> Expr {
517 arrow(cst("PerfectoidSpaceObj"), type0())
518}
519pub fn v_stack_ty() -> Expr {
522 arrow(cst("Site"), type0())
523}
524pub 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}
543pub fn prismatic_cohomology_ty() -> Expr {
546 arrow(cst("Scheme"), arrow(cst("Prism"), cst("AbelianGroup")))
547}
548pub 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}
567pub fn syntomic_cohomology_ty() -> Expr {
570 arrow(cst("Scheme"), arrow(nat_ty(), cst("AbelianGroup")))
571}
572pub fn fontaine_theory_ty() -> Expr {
575 arrow(
576 cst("PAdicField"),
577 arrow(cst("GaloisRepresentationObj"), cst("HodgeTateDecomp")),
578 )
579}
580pub 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}
604pub fn condensed_set_ty() -> Expr {
607 type0()
608}
609pub fn solid_abelian_group_ty() -> Expr {
612 arrow(cst("CondensedAbelianGroupObj"), prop())
613}
614pub fn liquid_vector_space_ty() -> Expr {
617 arrow(real_ty(), arrow(cst("CondensedVectorSpaceObj"), prop()))
618}
619pub 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}
633pub 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}
660pub fn motivic_cohomology_ty() -> Expr {
663 arrow(
664 cst("Scheme"),
665 arrow(int_ty(), arrow(int_ty(), cst("AbelianGroup"))),
666 )
667}
668pub fn mixed_motive_ty() -> Expr {
671 arrow(cst("NumberField"), type0())
672}
673pub fn slice_filtration_ty() -> Expr {
676 arrow(cst("MotiveObj"), arrow(nat_ty(), cst("MotiveObj")))
677}
678pub fn a1_homotopy_type_ty() -> Expr {
681 arrow(cst("Scheme"), cst("A1SpaceObj"))
682}
683pub 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}
703pub 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}
720pub 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}
743pub fn berkovich_space_ty() -> Expr {
746 arrow(cst("AffinoidAlgebra"), type0())
747}
748pub fn affinoid_algebra_ty() -> Expr {
751 arrow(cst("NonArchField"), type0())
752}
753pub fn adic_space_ty() -> Expr {
756 arrow(cst("HuberRing"), type0())
757}
758pub fn rigid_analytic_space_ty() -> Expr {
761 arrow(cst("NonArchField"), type0())
762}
763pub 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}
786pub 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}
801pub fn pro_etale_topos_ty() -> Expr {
804 arrow(cst("Scheme"), cst("Topos"))
805}
806pub 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}
826pub fn log_scheme_ty() -> Expr {
829 arrow(cst("Scheme"), arrow(cst("LogStructure"), type0()))
830}
831pub fn log_etale_cohomology_ty() -> Expr {
834 arrow(cst("LogSchemeObj"), arrow(nat_ty(), cst("AbelianGroup")))
835}
836pub fn log_crystalline_cohomology_ty() -> Expr {
839 arrow(cst("LogSchemeObj"), arrow(cst("Ring"), cst("AbelianGroup")))
840}
841pub fn neron_model_ty() -> Expr {
844 arrow(
845 cst("AbelianVarietyObj"),
846 arrow(cst("DVRing"), cst("GroupScheme")),
847 )
848}
849pub 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}
880pub 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}
903pub fn faltings_height_ty() -> Expr {
906 arrow(cst("AbelianVarietyObj"), real_ty())
907}
908pub 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}
933pub fn crystalline_cohomology_ty() -> Expr {
936 arrow(cst("Scheme"), arrow(cst("Ring"), cst("AbelianGroup")))
937}
938pub 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}
955pub 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}
1371pub fn weierstrass_discriminant(a: i64, b: i64) -> i64 {
1373 -16 * (4 * a.pow(3) + 27 * b.pow(2))
1374}
1375pub 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}
1383pub 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}
1392pub fn rank_lower_bound_2descent(_a: i64, _b: i64) -> usize {
1396 0
1397}