keszits egy main.py t ami paralell aszinkron general tobb ez...
Prompt
keszits egy main.py t ami paralell aszinkron general tobb ezer random p es q polinomot es azonnal pathuzamban aszinkron le futtatja ezzel a lean koddal es addig keres es general ujakat amig talal olyat ami sikeresen megfelel a lean kodnak egyidőben 50 darab kulon szal generaljon es ugy csinalf meg hogy az 50 kulon szal ne fedje at egymast tehat ne probalja mind az 50 egy adott polinom part meg csak az egyik ne írj semmi mást csak a teljes fájlokat es kommentek nem lehetnek benne! soha semmi egyszerusitett mock placeholder dummy szimulalt fake szart nem engedelyezek es teljes fájl roviditetlen production ready kód nem lehet trancutted nem lehet olyan hogy …és hasonlóan 50 xy nem lehet dummy to do sorry hiányosság minden fájl teljes kódját egyesével fájkba írod semmi mást nem írsz ezen kívűl import Mathlib abbrev PolyXY (K : Type*) [CommSemiring K] := MvPolynomial (Fin 2) K abbrev Qbar := AlgebraicClosure ℚ abbrev QbarPoly := PolyXY Qbar variable {K : Type*} [Field K] [CharZero K] def xPoly : PolyXY K := MvPolynomial.X (0 : Fin 2) def yPoly : PolyXY K := MvPolynomial.X (1 : Fin 2) def split_at (n : Nat) (L : List (PolyXY K)) : List (PolyXY K) × List (PolyXY K) := match n with | 0 => ([], L) | Nat.succ k => match L with | [] => ([], []) | x :: xs => let (l1, l2) := split_at k xs (x :: l1, l2) def forwardCore (scale : K) (dim : Nat) (L : List (PolyXY K)) : List (PolyXY K) := let g1 := (split_at dim L).1 let g2 := (split_at dim L).2 let h1 := List.zipWith (fun P Q => (P + Q) * MvPolynomial.C scale) g1 g2 let h2 := List.zipWith (fun P Q => (Q - P) * MvPolynomial.C scale) g1 g2 h1 ++ h2 def ValidDim (dim : Nat) : Prop := dim > 0 ∧ dim ≤ 18446744073709551615 / 2 def transform_precondition (dim : Nat) (L : List (PolyXY K)) : Prop := ValidDim dim ∧ L.length = dim + dim def mixForwardCore (scale : K) (dim : Nat) (L : List (PolyXY K)) (_ : transform_precondition dim L) : List (PolyXY K) := forwardCore scale dim L theorem forwardCore_on_pair (scale : K) (P Q : PolyXY K) : forwardCore scale 1 [P, Q] = [(P + Q) * MvPolynomial.C scale, (Q - P) * MvPolynomial.C scale] := by rfl theorem forwardCore_not_injective_on_unrestricted_lists (scale : K) : ∃ L1 L2 : List (PolyXY K), L1 ≠ L2 ∧ forwardCore scale 1 L1 = forwardCore scale 1 L2 := by refine ⟨[0], [1], ?_, ?_⟩ · intro h have h' : (0 : PolyXY K) = 1 := by simpa using congrArg (fun xs : List (PolyXY K) => xs.head?) h exact zero_ne_one h' · rfl abbrev Poly := PolyXY ℂ abbrev Point := Fin 2 → ℂ abbrev FunctionField := FractionRing Poly def origin : Point := fun _ => 0 def evalPair (P Q : Poly) (z : Point) : Point := fun i => if i = 0 then MvPolynomial.eval z P else MvPolynomial.eval z Q def HasPolynomialInverse (P Q : Poly) : Prop := ∃ R S : Poly, (∀ z : Point, evalPair R S (evalPair P Q z) = z) ∧ (∀ z : Point, evalPair P Q (evalPair R S z) = z) def InjectiveOnC2 (P Q : Poly) : Prop := Function.Injective (evalPair P Q) def HasAlgebraicCoefficients (P : Poly) : Prop := ∀ e ∈ P.support, IsAlgebraic ℚ (MvPolynomial.coeff e P) def jacobianDet (P Q : Poly) : Poly := MvPolynomial.pderiv (0 : Fin 2) P * MvPolynomial.pderiv (1 : Fin 2) Q - MvPolynomial.pderiv (1 : Fin 2) P * MvPolynomial.pderiv (0 : Fin 2) Q def HasConstantNonzeroJacobian (P Q : Poly) : Prop := ∃ c : ℂ, c ≠ 0 ∧ jacobianDet P Q = MvPolynomial.C c def jacobianMatrix (P Q : Poly) : Matrix (Fin 2) (Fin 2) Poly := fun i j => if i = 0 then if j = 0 then MvPolynomial.pderiv (0 : Fin 2) P else MvPolynomial.pderiv (1 : Fin 2) P else if j = 0 then MvPolynomial.pderiv (0 : Fin 2) Q else MvPolynomial.pderiv (1 : Fin 2) Q def jacobianAtOrigin (P Q : Poly) : Matrix (Fin 2) (Fin 2) ℂ := fun i j => MvPolynomial.eval origin (jacobianMatrix P Q i j) def generatedSubfield (P Q : Poly) : IntermediateField ℂ FunctionField := IntermediateField.adjoin ℂ ({algebraMap Poly FunctionField P, algebraMap Poly FunctionField Q} : Set FunctionField) def functionFieldDegree (P Q : Poly) : Nat := Module.finrank (generatedSubfield P Q) FunctionField def IsBirationalPolynomialMap (P Q : Poly) : Prop := FiniteDimensional (generatedSubfield P Q) FunctionField ∧ functionFieldDegree P Q = 1 def GeneratesFullPolynomialRing (P Q : Poly) : Prop := Algebra.adjoin ℂ ({P, Q} : Set Poly) = ⊤ def IsProperMap (F : Point → Point) : Prop := Continuous F ∧ ∀ s : Set Point, IsCompact s → IsCompact (F ⁻¹' s) def ProperAt (F : Point → Point) (y : Point) : Prop := Continuous F ∧ ∃ U : Set Point, IsOpen U ∧ y ∈ U ∧ ∀ s : Set Point, IsCompact s → s ⊆ U → IsCompact (F ⁻¹' s) def JelonekSet (P Q : Poly) : Set Point := {y | ¬ ProperAt (evalPair P Q) y} def zeroLocus (p : Poly) : Set Point := {z | MvPolynomial.eval z p = 0} def IsIrreducibleCurveComponent (C S : Set Point) : Prop := ∃ f : Poly, Irreducible f ∧ C = zeroLocus f ∧ C ⊆ S ∧ ∀ g : Poly, Irreducible g → zeroLocus g ⊆ S → C ⊆ zeroLocus g → zeroLocus g ⊆ C def curveParam (u v : Polynomial ℂ) (t : ℂ) : Point := fun i => if i = 0 then u.eval t else v.eval t def CUniruledCurve (S : Set Point) : Prop := ∃ u v : Polynomial ℂ, Set.range (curveParam u v) ⊆ S ∧ ∀ f : Poly, (∀ t : ℂ, MvPolynomial.eval (curveParam u v t) f = 0) → ∀ z ∈ S, MvPolynomial.eval z f = 0 def exponentTotalDegree (e : Fin 2 →₀ Nat) : Nat := e.sum fun _ n => n def leadingHomogeneous (p : Poly) : Poly := ∑ e ∈ p.support.filter (fun e => exponentTotalDegree e = p.totalDegree), MvPolynomial.monomial e (MvPolynomial.coeff e p) def exponentPoint (e : Fin 2 →₀ Nat) : Fin 2 → ℝ := fun i => (e i : ℝ) def NewtonPolygon (p : Poly) : Set (Fin 2 → ℝ) := convexHull ℝ (Set.image exponentPoint (p.support : Set (Fin 2 →₀ Nat))) def IsCompositeNat (n : Nat) : Prop := 1 < n ∧ ¬ Nat.Prime n structure DivisibilityConstraint (P Q : Poly) where divisor : Poly dividend : Poly dividend_is_coordinate : dividend = P ∨ dividend = Q quotient : Poly factorization : dividend = divisor * quotient structure PlaceAtInfinity where value : FunctionField → WithTop ℤ value_zero : value 0 = ⊤ value_one : value 1 = 0 value_mul : ∀ p q, value (p * q) = value p + value q value_add : ∀ p q, value (p + q) ≥ min (value p) (value q) value_nonzero : ∀ f, f ≠ 0 → value f ≠ ⊤ value_nonzero_constant : ∀ c : ℂ, c ≠ 0 → value (algebraMap Poly FunctionField (MvPolynomial.C c)) = 0 centered_at_infinity : ∃ p : Poly, value (algebraMap Poly FunctionField p) < 0 structure CompactificationAtInfinity where boundaryPlaces : Set PlaceAtInfinity structure PolynomialMapData where P : Poly Q : Poly P_has_algebraic_coefficients : HasAlgebraicCoefficients P Q_has_algebraic_coefficients : HasAlgebraicCoefficients Q degreeP : Nat degreeQ : Nat degreeP_eq : degreeP = P.totalDegree degreeQ_eq : degreeQ = Q.totalDegree divisibilityConstraints : List (DivisibilityConstraint P Q) gcd_degree_ge_16 : 16 ≤ Nat.gcd degreeP degreeQ gcd_degree_composite : IsCompositeNat (Nat.gcd degreeP degreeQ) moh_total_degree_gt_100 : 100 < max degreeP degreeQ functionFieldExtension_finite : FiniteDimensional (generatedSubfield P Q) FunctionField functionFieldExtensionDegree_ge_5 : 5 ≤ functionFieldDegree P Q functionFieldExtensionDegree_ne_two : functionFieldDegree P Q ≠ 2 functionFieldExtensionDegree_ne_three : functionFieldDegree P Q ≠ 3 functionFieldExtensionDegree_ne_four : functionFieldDegree P Q ≠ 4 compactification : CompactificationAtInfinity boundaryPlaces_are_at_infinity : ∀ v ∈ compactification.boundaryPlaces, v.centered_at_infinity jelonek_curve_components_C_uniruled : ∀ C : Set Point, IsIrreducibleCurveComponent C (JelonekSet P Q) → CUniruledCurve C origin_is_fixed : evalPair P Q origin = origin jacobian_at_origin_is_identity : jacobianAtOrigin P Q = 1 jacobian_determinant_is_one : jacobianDet P Q = MvPolynomial.C 1 jacobian_is_constant_nonzero : HasConstantNonzeroJacobian P Q no_polynomial_inverse : ¬ HasPolynomialInverse P Q inverse_iff_all_map_properties : HasPolynomialInverse P Q ↔ (InjectiveOnC2 P Q ∧ IsBirationalPolynomialMap P Q ∧ IsProperMap (evalPair P Q) ∧ GeneratesFullPolynomialRing P Q) theorem no_inverse_implies_some_map_property_fails (D : PolynomialMapData) : ¬ InjectiveOnC2 D.P D.Q ∨ ¬ IsBirationalPolynomialMap D.P D.Q ∨ ¬ IsProperMap (evalPair D.P D.Q) ∨ ¬ GeneratesFullPolynomialRing D.P D.Q := by classical by_contra h push_neg at h exact D.no_polynomial_inverse (D.inverse_iff_all_map_properties.mpr h)
Response not available