roseking commited on
Commit
21d731e
·
verified ·
1 Parent(s): f18e7de

Add lean source and binary files (part 86)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei.lean +113 -0
  2. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/SlabResidualScale.lean +100 -0
  3. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/SlabSections.lean +200 -0
  4. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/SlabVerticalCoordinates.lean +98 -0
  5. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedCoulombDerivative.lean +97 -0
  6. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedFarQuadrature.lean +132 -0
  7. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedGrid.lean +95 -0
  8. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedHybrid.lean +87 -0
  9. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedNearForm.lean +50 -0
  10. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedNearGrid.lean +74 -0
  11. lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedNodes.lean +96 -0
  12. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle.lean +432 -0
  13. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AbsoluteNuclearForm.lean +66 -0
  14. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AffinePhysicalOutput.lean +78 -0
  15. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AffinePhysicalThreshold.lean +127 -0
  16. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/ApproximateBisection.lean +220 -0
  17. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AtomicOutputs.lean +100 -0
  18. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/BoundedFormCross.lean +101 -0
  19. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/BoundedPotentialOperator.lean +109 -0
  20. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisection.lean +96 -0
  21. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisectionLocation.lean +60 -0
  22. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisectionMachine.lean +25 -0
  23. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisectionSchedule.lean +95 -0
  24. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedContactCorrectness.lean +82 -0
  25. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationBudget.lean +56 -0
  26. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationComponents.lean +126 -0
  27. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationError.lean +69 -0
  28. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationParameters.lean +33 -0
  29. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedGraphError.lean +80 -0
  30. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedHoppingBound.lean +58 -0
  31. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedLipschitzBound.lean +66 -0
  32. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedMatrixError.lean +69 -0
  33. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationCoefficientError.lean +44 -0
  34. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationCoulombBrackets.lean +76 -0
  35. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationEndpointSigns.lean +108 -0
  36. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationGraphBudget.lean +60 -0
  37. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationMesh.lean +62 -0
  38. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationRationalBracket.lean +60 -0
  39. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationSquareError.lean +54 -0
  40. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedCoulombKernel.lean +160 -0
  41. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedCoulombMass.lean +62 -0
  42. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedCoulombTruncation.lean +95 -0
  43. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedRawModulus.lean +74 -0
  44. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedWells.lean +159 -0
  45. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredGaussEquiv.lean +74 -0
  46. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredGaussLabels.lean +73 -0
  47. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredGrid.lean +98 -0
  48. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredPhysicalThreshold.lean +121 -0
  49. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/ClassicalH1.lean +51 -0
  50. lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/ClassicalResidualPairing.lean +135 -0
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei.lean ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.Cubature
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.DensitySynthesis
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.EulerApproximation
4
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.EulerGeometry
5
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.EulerInitialBox
6
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.EulerRegisters
7
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.EulerSchedule
8
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.EulerTrajectory
9
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowActualBound
10
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowActualFirstBound
11
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowCompactExtension
12
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowDeterminant
13
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowFirstBound
14
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowGlobalExistence
15
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowGlobalRegularity
16
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowHigherComposition
17
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowImplicit
18
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowIntervalUniqueness
19
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowJacobianVariation
20
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowJetCoordinates
21
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowJetGronwall
22
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowJetVariation
23
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowLiouville
24
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowLocal
25
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowLocalBound
26
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowLocalDomain
27
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowLocalEquation
28
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowLocalModel
29
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowMatrix
30
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowMixedDerivative
31
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowPathEquation
32
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowPathFamily
33
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowPathJets
34
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowSliceBound
35
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowSpatialRegularity
36
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowUniform
37
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.FlowVariational
38
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussEightNodes
39
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussGrid
40
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussLocal
41
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussLocalPositionCell
42
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussPhysicalCell
43
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussPositionCell
44
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussTensorError
45
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserBounds
46
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserChargeBounds
47
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserCoordinateDifferences
48
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserDerivatives
49
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserDifferenceBudget
50
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserEndpoint
51
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserFlow
52
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserFlowRegularity
53
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserFlux
54
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserGridPotential
55
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserIntegrability
56
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserIntegralBound
57
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserInverse
58
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserJacobian
59
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserNumericalBounds
60
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserRegularity
61
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserTransport
62
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserUniformDensity
63
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserUniformInverse
64
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserUniformVelocity
65
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserVelocityNumerics
66
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearCoordinateOutput
67
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearCoordinates
68
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearCross
69
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearCutoff
70
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearGridCoordinates
71
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearGridPotential
72
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearMeshBalance
73
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearMultiplier
74
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearNearEstimate
75
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearPacking
76
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearPerturbedComplement
77
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearPromise
78
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearQuadratureScale
79
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearRounding
80
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearTensorCompression
81
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.RoundedEuler
82
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.RoundingPolynomialBudget
83
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabBoxResidual
84
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabBoxSchedule
85
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabConfinement
86
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabCoordinates
87
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabGrid
88
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabHighAspectRatio
89
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabInterior
90
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabKernelEstimates
91
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabLineFlatness
92
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabLineIntegral
93
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabMonotonicity
94
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabOrbitalResidual
95
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabOriginQuadrature
96
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabOriginSchedule
97
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabOriginValue
98
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabPlanarIntegral
99
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabPlanarTail
100
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabPolynomialResidual
101
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabProfile
102
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabRegularity
103
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabRegularization
104
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabResidualScale
105
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabSections
106
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabVerticalCoordinates
107
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedCoulombDerivative
108
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedFarQuadrature
109
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedGrid
110
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedHybrid
111
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedNearForm
112
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedNearGrid
113
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedNodes
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/SlabResidualScale.lean ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabOrbitalResidual
2
+
3
+ namespace OAI
4
+
5
+ /-! A polynomial choice of slab dimensions makes the actual orbital
6
+ residual small. The twenty-fourth moment absorbs the total slab mass. -/
7
+
8
+ noncomputable section
9
+ open MeasureTheory
10
+ namespace ContinuumCoulomb
11
+
12
+ theorem slabDomain_volume {H S : ℝ} (hH : 0 ≤ H) (hS : 0 ≤ S) :
13
+ volume.real (slabDomain H S) = 8*H^2*S := by
14
+ have h := (slabProduct_measurePreserving H S).measureReal_preimage
15
+ (s := Set.univ) MeasurableSet.univ.nullMeasurableSet
16
+ rw [Set.preimage_univ, measureReal_restrict_apply_univ] at h
17
+ rw [← h, Measure.real, slabProductMeasure, Measure.pi_univ, Fin.prod_univ_three,
18
+ ENNReal.toReal_mul, ENNReal.toReal_mul]
19
+ simp only [slabAxisMeasure, Measure.restrict_apply_univ, Real.volume_Icc]
20
+ norm_num [slabSide, ENNReal.toReal_ofReal, hH, hS]
21
+ ring
22
+
23
+ def slabGrowthConstant (rho : ℝ) : ℝ :=
24
+ rho*(|NeutralAtom.kernelBallMass 1|+8)
25
+
26
+ theorem slabUniformBound_polynomial {rho T : ℝ} (hrho : 0 ≤ rho) (hT : 1 ≤ T) :
27
+ slabUniformBound rho (T^4) T ≤ slabGrowthConstant rho*T^9 := by
28
+ rw [slabUniformBound, slabDomain_volume (by positivity) (by linarith)]
29
+ have hp : 1 ≤ T^9 := one_le_pow₀ hT
30
+ have h1 : rho*NeutralAtom.kernelBallMass 1 ≤ rho*|NeutralAtom.kernelBallMass 1| *T^9 := by
31
+ calc
32
+ _ ≤ rho*|NeutralAtom.kernelBallMass 1| := mul_le_mul_of_nonneg_left (le_abs_self _) hrho
33
+ _ ≤ _ := le_mul_of_one_le_right (mul_nonneg hrho (abs_nonneg _)) hp
34
+ dsimp [slabGrowthConstant]
35
+ nlinarith only [h1]
36
+
37
+ def slabResidualPolynomialBound (rho freq : ℝ) (u : PlanarPosition) : ℝ :=
38
+ 72*Real.pi^2*rho^2+8192*rho^2*localizedDensityMoment freq u 4+
39
+ 8*(slabGrowthConstant rho)^2*localizedDensityMoment freq u 24+
40
+ 8*Real.pi^2*rho^2*localizedDensityMoment freq u 24
41
+
42
+ private theorem div_pow_le_div_sq {T C : ℝ} (hT : 1 ≤ T) (hC : 0 ≤ C)
43
+ {k : ℕ} (hk : 2 ≤ k) : C/T^k ≤ C/T^2 :=
44
+ div_le_div_of_nonneg_left hC (by positivity) (pow_le_pow_right₀ hT hk)
45
+
46
+ theorem slabOrbitalResidual_polynomial_bound {rho T freq : ℝ}
47
+ (hrho : 0 ≤ rho) (hT : 2 ≤ T) (hfreq : 0 < freq) (u : PlanarPosition) :
48
+ (∫ x, slabOrbitalResidual rho (T^4) T freq u x^2) ≤
49
+ slabResidualPolynomialBound rho freq u/T^2 := by
50
+ have hTpos : 0 < T := by linarith
51
+ have hT1 : 1 ≤ T := by linarith
52
+ have hT4 : T ≤ T^4/2 := by
53
+ have h2 : 2*T ≤ T^2 := by nlinarith [mul_nonneg hTpos.le (sub_nonneg.mpr hT)]
54
+ have h4 : T^2 ≤ T^4 := by
55
+ exact pow_le_pow_right₀ hT1 (by decide : 2 ≤ 4)
56
+ linarith
57
+ have h := slabOrbitalResidual_square_bound hrho (pow_pos hTpos 4) hTpos.le hfreq
58
+ hTpos hT4 le_rfl u
59
+ have hB0 : 0 ≤ slabUniformBound rho (T^4) T := by
60
+ have h0 := slabPotential_abs_bound hrho (pow_nonneg hTpos.le 4) hTpos.le (0 : Position)
61
+ exact (abs_nonneg _).trans h0
62
+ have hB := (sq_le_sq₀ hB0 (by dsimp [slabGrowthConstant]; positivity)).mpr
63
+ (slabUniformBound_polynomial hrho hT1)
64
+ have hBterm : 2*(2*slabUniformBound rho (T^4) T)^2*
65
+ (localizedDensityMoment freq u 24/T^24) ≤
66
+ 8*(slabGrowthConstant rho)^2*localizedDensityMoment freq u 24/T^6 := by
67
+ have hb := mul_le_mul_of_nonneg_right hB
68
+ (show 0 ≤ 8*(localizedDensityMoment freq u 24/T^24) by
69
+ exact mul_nonneg (by norm_num) (div_nonneg (localizedDensityMoment_nonnegative _ _ _)
70
+ (pow_nonneg hTpos.le _)))
71
+ convert hb using 1
72
+ all_goals field_simp [ne_of_gt hTpos]
73
+ all_goals ring
74
+ have he1 : 2*(6*Real.pi*rho*T^3/T^4)^2 = 72*Real.pi^2*rho^2/T^2 := by
75
+ field_simp [ne_of_gt hTpos]
76
+ ring
77
+ have he2 : 2*(64*rho*T/T^4)^2*localizedDensityMoment freq u 4 =
78
+ 8192*rho^2*localizedDensityMoment freq u 4/T^6 := by
79
+ field_simp [ne_of_gt hTpos]
80
+ ring
81
+ have he4 : 2*(2*Real.pi*rho)^2*(localizedDensityMoment freq u 24/T^20) =
82
+ 8*Real.pi^2*rho^2*localizedDensityMoment freq u 24/T^20 := by ring
83
+ rw [he1,he2,he4] at h
84
+ have h2 := div_pow_le_div_sq hT1
85
+ (mul_nonneg (mul_nonneg (by norm_num : (0:ℝ)≤8192) (sq_nonneg rho))
86
+ (localizedDensityMoment_nonnegative freq u 4)) (by decide : 2 ≤ 6)
87
+ have h3 := div_pow_le_div_sq hT1
88
+ (mul_nonneg (mul_nonneg (by norm_num : (0:ℝ)≤8) (sq_nonneg (slabGrowthConstant rho)))
89
+ (localizedDensityMoment_nonnegative freq u 24)) (by decide : 2 ≤ 6)
90
+ have h4 := div_pow_le_div_sq hT1
91
+ (mul_nonneg (by positivity : 0 ≤ 8*Real.pi^2*rho^2)
92
+ (localizedDensityMoment_nonnegative freq u 24)) (by decide : 2 ≤ 20)
93
+ have hs := h.trans (add_le_add (add_le_add (add_le_add le_rfl h2) (hBterm.trans h3)) h4)
94
+ simpa only [slabResidualPolynomialBound, add_div] using hs
95
+
96
+ end ContinuumCoulomb
97
+
98
+ end
99
+
100
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/SlabSections.lean ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabRegularization
2
+
3
+ namespace OAI
4
+
5
+ /-! Finite product sections of the actual rectangular slab measure. -/
6
+
7
+ noncomputable section
8
+ open MeasureTheory Filter
9
+ open scoped BigOperators Topology
10
+ namespace ContinuumCoulomb
11
+
12
+ def slabSide (H S : ℝ) (i : Fin 3) : ℝ := if i = 2 then S else H
13
+
14
+ def slabAxisMeasure (H S : ℝ) (i : Fin 3) : Measure ℝ :=
15
+ volume.restrict (Set.Icc (-slabSide H S i) (slabSide H S i))
16
+
17
+ def slabProductMeasure (H S : ℝ) : Measure (Fin 3 → ℝ) :=
18
+ Measure.pi (slabAxisMeasure H S)
19
+
20
+ def slabProductDomain (H S : ℝ) : Set (Fin 3 → ℝ) :=
21
+ Set.univ.pi (fun i => Set.Icc (-slabSide H S i) (slabSide H S i))
22
+
23
+ theorem slabProductDomain_preimage (H S : ℝ) :
24
+ (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)).symm ⁻¹' slabProductDomain H S = slabDomain H S := by
25
+ ext x
26
+ change (∀ i : Fin 3, i ∈ Set.univ → -slabSide H S i ≤ x i ∧ x i ≤ slabSide H S i) ↔
27
+ |x 0| ≤ H ∧ |x 1| ≤ H ∧ |x 2| ≤ S
28
+ simp only [Set.mem_univ, true_implies, abs_le]
29
+ constructor
30
+ · intro h
31
+ exact ⟨by simpa [slabSide] using h 0,
32
+ by simpa [slabSide] using h 1, by simpa [slabSide] using h 2⟩
33
+ · rintro ⟨h0, h1, h2⟩ i
34
+ fin_cases i
35
+ · simpa [slabSide] using h0
36
+ · simpa [slabSide] using h1
37
+ · simpa [slabSide] using h2
38
+
39
+ theorem slabProductMeasure_eq (H S : ℝ) :
40
+ slabProductMeasure H S = (volume : Measure (Fin 3 → ℝ)).restrict (slabProductDomain H S) := by
41
+ exact (Measure.restrict_pi_pi (fun _ : Fin 3 => (volume : Measure ℝ))
42
+ (fun i => Set.Icc (-slabSide H S i) (slabSide H S i))).symm
43
+
44
+ theorem slabProduct_measurePreserving (H S : ℝ) :
45
+ MeasurePreserving (MeasurableEquiv.toLp 2 (Fin 3 → ℝ))
46
+ (slabProductMeasure H S) (volume.restrict (slabDomain H S)) := by
47
+ have hm := (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin 3)).restrict_preimage
48
+ (s := slabProductDomain H S)
49
+ (MeasurableSet.univ_pi (fun i => measurableSet_Icc))
50
+ rw [slabProductDomain_preimage, ← slabProductMeasure_eq] at hm
51
+ exact MeasurePreserving.symm (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)).symm hm
52
+
53
+ theorem slabProduct_integral (H S : ℝ) (f : Position → ℝ) :
54
+ (∫ x, f (WithLp.toLp 2 x) ∂slabProductMeasure H S) =
55
+ ∫ y in slabDomain H S, f y := by
56
+ exact (slabProduct_measurePreserving H S).integral_comp' f
57
+
58
+ theorem slabProduct_integrable (H S : ℝ) (f : Position → ℝ) :
59
+ Integrable (fun x => f (WithLp.toLp 2 x)) (slabProductMeasure H S) ↔
60
+ IntegrableOn f (slabDomain H S) :=
61
+ (slabProduct_measurePreserving H S).integrable_comp_emb
62
+ (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)).measurableEmbedding
63
+
64
+ theorem regularizedKernel_eq_sqrt (epsilon : ℝ) (x : Position) :
65
+ NeutralAtom.regularizedKernel epsilon x = (Real.sqrt (‖x‖^2+epsilon^2))⁻¹ := by
66
+ rw [NeutralAtom.regularizedKernel, Real.sqrt_eq_rpow]
67
+ convert Real.rpow_neg (add_nonneg (sq_nonneg ‖x‖) (sq_nonneg epsilon)) (1/2:ℝ) using 1
68
+ norm_num
69
+
70
+ theorem regularizedKernel_section (epsilon : ℝ) (y : Position) (i : Fin 3)
71
+ (t : ℝ) (v : Fin 2 → ℝ) :
72
+ NeutralAtom.regularizedKernel epsilon (y-WithLp.toLp 2 (i.insertNth t v)) =
73
+ coulombLineKernel
74
+ (epsilon^2+∑ j : Fin 2, (y (i.succAbove j)-v j)^2) (y i-t) := by
75
+ rw [regularizedKernel_eq_sqrt]
76
+ unfold coulombLineKernel
77
+ congr 2
78
+ rw [EuclideanSpace.real_norm_sq_eq, Fin.sum_univ_succAbove _ i]
79
+ simp only [PiLp.sub_apply, Fin.insertNth_apply_same,
80
+ Fin.insertNth_apply_succAbove]
81
+ ring
82
+
83
+ instance slabAxisMeasure_finite (H S : ℝ) (i : Fin 3) :
84
+ IsFiniteMeasure (slabAxisMeasure H S i) := by
85
+ unfold slabAxisMeasure
86
+ infer_instance
87
+
88
+ def zeroPositionCoordinate (i : Fin 3) (y : Position) : Position :=
89
+ WithLp.toLp 2 (Function.update (WithLp.ofLp y) i 0)
90
+
91
+ theorem zeroPositionCoordinate_same (i : Fin 3) (y : Position) :
92
+ zeroPositionCoordinate i y i = 0 := by simp [zeroPositionCoordinate]
93
+
94
+ theorem zeroPositionCoordinate_other (i : Fin 3) (y : Position) (j : Fin 2) :
95
+ zeroPositionCoordinate i y (i.succAbove j) = y (i.succAbove j) := by
96
+ simp [zeroPositionCoordinate, Fin.succAbove_ne]
97
+
98
+ private theorem regularizedProduct_integrable {epsilon H S : ℝ} (hepsilon : epsilon ≠ 0)
99
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (y : Position) :
100
+ Integrable (fun x : Fin 3 → ℝ => NeutralAtom.regularizedKernel epsilon
101
+ (y-WithLp.toLp 2 x)) (slabProductMeasure H S) :=
102
+ (slabProduct_integrable H S _).mpr (regularizedSlab_integrableOn hepsilon hH hS y)
103
+
104
+ private theorem regularizedSection_integrable {epsilon H S : ℝ} (hepsilon : epsilon ≠ 0)
105
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (y : Position) (i : Fin 3) :
106
+ Integrable (fun p : ℝ × (Fin 2 → ℝ) => NeutralAtom.regularizedKernel epsilon
107
+ (y-WithLp.toLp 2 (i.insertNth p.1 p.2)))
108
+ ((slabAxisMeasure H S i).prod
109
+ (Measure.pi (fun j : Fin 2 => slabAxisMeasure H S (i.succAbove j)))) := by
110
+ have hp := (measurePreserving_piFinSuccAbove (slabAxisMeasure H S) i).symm
111
+ have h := (hp.integrable_comp_emb
112
+ (MeasurableEquiv.piFinSuccAbove (fun _ : Fin 3 => ℝ) i).symm.measurableEmbedding).mpr
113
+ (regularizedProduct_integrable hepsilon hH hS y)
114
+ exact h
115
+
116
+ theorem regularizedSlab_sectionIntegral {epsilon H S : ℝ} (hepsilon : epsilon ≠ 0)
117
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (y : Position) (i : Fin 3) :
118
+ (∫ x in slabDomain H S, NeutralAtom.regularizedKernel epsilon (y-x)) =
119
+ ∫ v : Fin 2 → ℝ, ∫ t : ℝ,
120
+ NeutralAtom.regularizedKernel epsilon (y-WithLp.toLp 2 (i.insertNth t v))
121
+ ∂slabAxisMeasure H S i
122
+ ∂Measure.pi (fun j : Fin 2 => slabAxisMeasure H S (i.succAbove j)) := by
123
+ rw [← slabProduct_integral H S (fun x => NeutralAtom.regularizedKernel epsilon (y-x))]
124
+ change (∫ x : Fin 3 → ℝ, NeutralAtom.regularizedKernel epsilon (y-WithLp.toLp 2 x)
125
+ ∂Measure.pi (slabAxisMeasure H S)) = _
126
+ rw [← ((measurePreserving_piFinSuccAbove (slabAxisMeasure H S) i).symm).integral_comp']
127
+ simp only [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv]
128
+ exact integral_prod_symm _ (regularizedSection_integrable hepsilon hH hS y i)
129
+
130
+ private theorem coulombLine_setIntegral_le_center {A H : ℝ} (hA : 0 < A) (hH : 0 ≤ H)
131
+ (x : ℝ) :
132
+ (∫ t in Set.Icc (-H) H, coulombLineKernel A (x-t)) ≤
133
+ ∫ t in Set.Icc (-H) H, coulombLineKernel A (0-t) := by
134
+ have h := coulombLineIntegral_le_center hA hH x
135
+ simp only [centeredLineIntegral_translate,
136
+ intervalIntegral.integral_of_le (show -H ≤ H by linarith),
137
+ ← integral_Icc_eq_integral_Ioc] at h
138
+ exact h
139
+
140
+ /-- Centering one coordinate increases the attractive Coulomb integral.
141
+ The statement holds for the actual finite slab, before taking the singular limit. -/
142
+ theorem regularizedSlab_coordinate_max {epsilon H S : ℝ} (hepsilon : epsilon ≠ 0)
143
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (y : Position) (i : Fin 3) :
144
+ (∫ x in slabDomain H S, NeutralAtom.regularizedKernel epsilon (y-x)) ≤
145
+ ∫ x in slabDomain H S, NeutralAtom.regularizedKernel epsilon
146
+ (zeroPositionCoordinate i y-x) := by
147
+ rw [regularizedSlab_sectionIntegral hepsilon hH hS y i,
148
+ regularizedSlab_sectionIntegral hepsilon hH hS (zeroPositionCoordinate i y) i]
149
+ apply integral_mono
150
+ (regularizedSection_integrable hepsilon hH hS y i).integral_prod_right
151
+ (regularizedSection_integrable hepsilon hH hS (zeroPositionCoordinate i y) i).integral_prod_right
152
+ intro v
153
+ simp_rw [regularizedKernel_section, zeroPositionCoordinate_same, zeroPositionCoordinate_other]
154
+ have hA : 0 < epsilon^2+∑ j : Fin 2, (y (i.succAbove j)-v j)^2 :=
155
+ add_pos_of_pos_of_nonneg (sq_pos_of_ne_zero hepsilon)
156
+ (Finset.sum_nonneg (fun _ _ => sq_nonneg _))
157
+ have hside : 0 ≤ slabSide H S i := by unfold slabSide; split <;> assumption
158
+ exact coulombLine_setIntegral_le_center hA hside (y i)
159
+
160
+ /-- The actual singular finite-slab potential is minimized in each centered
161
+ coordinate. The regularized comparison passes through a dominated limit. -/
162
+ theorem slabPotential_coordinate_min {rho H S : ℝ} (hrho : 0 ≤ rho)
163
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (y : Position) (i : Fin 3) :
164
+ slabPotential rho H S (zeroPositionCoordinate i y) ≤ slabPotential rho H S y := by
165
+ let epsilon : ℕ → ℝ := fun n => ((n:ℝ)+1)⁻¹
166
+ have hep (n : ℕ) : 0 < epsilon n := by dsimp [epsilon]; positivity
167
+ have heps : Tendsto epsilon atTop (𝓝 0) :=
168
+ tendsto_inv_atTop_zero.comp
169
+ (tendsto_atTop_add_const_right _ 1 tendsto_natCast_atTop_atTop)
170
+ apply le_of_tendsto_of_tendsto
171
+ (regularizedSlabPotential_tendsto hep heps rho hH hS (zeroPositionCoordinate i y))
172
+ (regularizedSlabPotential_tendsto hep heps rho hH hS y)
173
+ exact Filter.Eventually.of_forall (fun n =>
174
+ mul_le_mul_of_nonpos_left (regularizedSlab_coordinate_max (hep n).ne' hH hS y i)
175
+ (neg_nonpos.mpr hrho))
176
+
177
+ theorem slabPotential_minimum {rho H S : ℝ} (hrho : 0 ≤ rho)
178
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (y : Position) :
179
+ slabPotential rho H S 0 ≤ slabPotential rho H S y := by
180
+ have h0 := slabPotential_coordinate_min hrho hH hS y 0
181
+ have h1 := slabPotential_coordinate_min hrho hH hS (zeroPositionCoordinate 0 y) 1
182
+ have h2 := slabPotential_coordinate_min hrho hH hS
183
+ (zeroPositionCoordinate 1 (zeroPositionCoordinate 0 y)) 2
184
+ have he : zeroPositionCoordinate 2 (zeroPositionCoordinate 1 (zeroPositionCoordinate 0 y)) = 0 := by
185
+ ext j
186
+ fin_cases j <;> simp [zeroPositionCoordinate]
187
+ rw [he] at h2
188
+ exact h2.trans (h1.trans h0)
189
+
190
+ theorem slabPotential_nonpositive {rho : ℝ} (hrho : 0 ≤ rho) (H S : ℝ) (y : Position) :
191
+ slabPotential rho H S y ≤ 0 := by
192
+ rw [slabPotential_eq_setIntegral]
193
+ exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hrho)
194
+ (integral_nonneg (fun x => inv_nonneg.mpr (norm_nonneg (y-x))))
195
+
196
+ end ContinuumCoulomb
197
+
198
+ end
199
+
200
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/SlabVerticalCoordinates.lean ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabPlanarTail
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabSections
3
+
4
+ namespace OAI
5
+
6
+ /-! Vertical-first coordinates for the actual three-dimensional slab. -/
7
+
8
+ noncomputable section
9
+ open MeasureTheory
10
+ open scoped BigOperators
11
+ namespace ContinuumCoulomb
12
+
13
+ def slabVerticalEquiv : Position ≃ᵐ ℝ × PlanarPosition :=
14
+ (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)).symm.trans
15
+ ((MeasurableEquiv.piFinSuccAbove (fun _ : Fin 3 => ℝ) 2).trans
16
+ ((MeasurableEquiv.refl ℝ).prodCongr (MeasurableEquiv.toLp 2 (Fin 2 → ℝ))))
17
+
18
+ theorem slabVerticalEquiv_symm_apply (p : ℝ × PlanarPosition) :
19
+ slabVerticalEquiv.symm p = WithLp.toLp 2 ![p.2 0, p.2 1, p.1] := by
20
+ ext i
21
+ fin_cases i <;> rfl
22
+
23
+ theorem slabVerticalEquiv_apply (x : Position) :
24
+ slabVerticalEquiv x = (x 2, WithLp.toLp 2 ![x 0, x 1]) := by
25
+ apply Prod.ext
26
+ · rfl
27
+ · ext i
28
+ fin_cases i <;> rfl
29
+
30
+ theorem slabVerticalEquiv_measurePreserving : MeasurePreserving slabVerticalEquiv :=
31
+ ((MeasurePreserving.id volume).prod (PiLp.volume_preserving_toLp (Fin 2))).comp
32
+ ((volume_preserving_piFinSuccAbove (fun _ : Fin 3 => ℝ) 2).comp
33
+ (PiLp.volume_preserving_ofLp (Fin 3)))
34
+
35
+ theorem slabVerticalEquiv_preimage (H S : ℝ) :
36
+ slabVerticalEquiv ⁻¹' (Set.Icc (-S) S ×ˢ slabPlanarBox H) = slabDomain H S := by
37
+ ext x
38
+ simp only [Set.mem_preimage, Set.mem_prod, Set.mem_Icc, slabVerticalEquiv_apply,
39
+ slabPlanarBox, Set.mem_ofPred_eq, Matrix.cons_val_zero,
40
+ Matrix.cons_val_one, Matrix.cons_val_fin_one, slabDomain, abs_le]
41
+ tauto
42
+
43
+ theorem slabVertical_setIntegral (H S : ℝ) (f : Position → ℝ) :
44
+ (∫ x in slabDomain H S, f x) =
45
+ ∫ p in Set.Icc (-S) S ×ˢ slabPlanarBox H, f (slabVerticalEquiv.symm p) := by
46
+ have h := slabVerticalEquiv_measurePreserving.restrict_preimage
47
+ (s := Set.Icc (-S) S ×ˢ slabPlanarBox H)
48
+ (measurableSet_Icc.prod (slabPlanarBox_measurable H))
49
+ rw [slabVerticalEquiv_preimage] at h
50
+ simpa only [Function.comp_apply, MeasurableEquiv.symm_apply_apply] using
51
+ h.integral_comp' (f ∘ slabVerticalEquiv.symm)
52
+
53
+ def slabAxisPoint (z : ℝ) : Position := WithLp.toLp 2 ![0,0,z]
54
+
55
+ theorem regularizedSlab_vertical_kernel (epsilon z : ℝ) (p : ℝ × PlanarPosition) :
56
+ NeutralAtom.regularizedKernel epsilon (slabAxisPoint z-slabVerticalEquiv.symm p) =
57
+ coulombLineKernel (epsilon^2+(z-p.1)^2) ‖p.2‖ := by
58
+ rw [regularizedKernel_eq_sqrt, slabVerticalEquiv_symm_apply]
59
+ unfold coulombLineKernel
60
+ congr 2
61
+ rw [EuclideanSpace.real_norm_sq_eq, EuclideanSpace.real_norm_sq_eq]
62
+ simp only [slabAxisPoint, PiLp.sub_apply, Fin.sum_univ_succ,
63
+ Fin.sum_univ_zero, Matrix.cons_val_zero, Matrix.cons_val_succ, Matrix.cons_val_fin_one,
64
+ zero_sub, neg_sq]
65
+ rw [Fin.succ_zero_eq_one]
66
+ ring
67
+
68
+ theorem regularizedSlab_vertical_integrable {epsilon H S : ℝ} (hepsilon : epsilon ≠ 0)
69
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (z : ℝ) :
70
+ IntegrableOn (fun p : ℝ × PlanarPosition =>
71
+ coulombLineKernel (epsilon^2+(z-p.1)^2) ‖p.2‖)
72
+ (Set.Icc (-S) S ×ˢ slabPlanarBox H) := by
73
+ have h := slabVerticalEquiv_measurePreserving.restrict_preimage
74
+ (s := Set.Icc (-S) S ×ˢ slabPlanarBox H)
75
+ (measurableSet_Icc.prod (slabPlanarBox_measurable H))
76
+ rw [slabVerticalEquiv_preimage] at h
77
+ have hs := (MeasurePreserving.symm slabVerticalEquiv h).integrable_comp_emb
78
+ (g := fun x : Position => NeutralAtom.regularizedKernel epsilon (slabAxisPoint z-x))
79
+ slabVerticalEquiv.symm.measurableEmbedding
80
+ exact (hs.mpr (regularizedSlab_integrableOn hepsilon hH hS (slabAxisPoint z))).congr
81
+ (Filter.Eventually.of_forall (regularizedSlab_vertical_kernel epsilon z))
82
+
83
+ theorem regularizedSlab_vertical (epsilon rho : ℝ) {H S : ℝ} (hepsilon : epsilon ≠ 0)
84
+ (hH : 0 ≤ H) (hS : 0 ≤ S) (z : ℝ) :
85
+ regularizedSlabPotential epsilon rho H S (slabAxisPoint z) =
86
+ -rho * ∫ w in Set.Icc (-S) S, ∫ p in slabPlanarBox H,
87
+ coulombLineKernel (epsilon^2+(z-w)^2) ‖p‖ := by
88
+ unfold regularizedSlabPotential
89
+ rw [slabVertical_setIntegral]
90
+ simp_rw [regularizedSlab_vertical_kernel]
91
+ rw [Measure.volume_eq_prod, setIntegral_prod _
92
+ (regularizedSlab_vertical_integrable hepsilon hH hS z)]
93
+
94
+ end ContinuumCoulomb
95
+
96
+ end
97
+
98
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedCoulombDerivative.lean ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombFarCell
2
+ import Mathlib.Analysis.Calculus.ContDiff.Bounds
3
+
4
+ namespace OAI
5
+
6
+ /-! Fourth derivatives of the Coulomb integrand after the Moser map. The
7
+ estimate is local at a point and needs no regularity across the pole. -/
8
+
9
+ noncomputable section
10
+ namespace ContinuumCoulomb
11
+
12
+ theorem fourth_composite_norm_bound (f : Position → ℝ) (G : Position → Position) (x : Position)
13
+ (hf : ContDiffAt ℝ 4 f (G x)) (hG : ContDiff ℝ 4 G) {C D : ℝ}
14
+ (hC : ∀ k : ℕ, k ≤ 4 → ‖iteratedFDeriv ℝ k f (G x)‖ ≤ C)
15
+ (hD : ∀ k : ℕ, 1 ≤ k → k ≤ 4 → ‖iteratedFDeriv ℝ k G x‖ ≤ D^k) :
16
+ ‖iteratedFDeriv ℝ 4 (f ∘ G) x‖ ≤ 24*C*D^4 := by
17
+ obtain ⟨U,hU,hx,hfU⟩ := hf.contDiffOn' le_rfl (by norm_num)
18
+ have hfU : ContDiffOn ℝ 4 f U := by simpa using hfU
19
+ have hS : IsOpen (G ⁻¹' U) := hU.preimage hG.continuous
20
+ have hc := norm_iteratedFDerivWithin_comp_le hfU hG.contDiffOn (n := 4) le_rfl
21
+ hU.uniqueDiffOn hS.uniqueDiffOn (fun _ hy => hy) hx
22
+ (fun k hk => by
23
+ rw [iteratedFDerivWithin_eq_iteratedFDeriv hU.uniqueDiffOn (hf.of_le (by exact_mod_cast hk)) hx]
24
+ exact hC k hk)
25
+ (fun k hk hk' => by
26
+ rw [iteratedFDerivWithin_eq_iteratedFDeriv (f := G) (x := x) (s := G ⁻¹' U) hS.uniqueDiffOn
27
+ (hG.of_le (by exact_mod_cast hk')).contDiffAt hx]
28
+ exact hD k hk hk')
29
+ rw [iteratedFDerivWithin_eq_iteratedFDeriv (f := f ∘ G) (x := x) (s := G ⁻¹' U) hS.uniqueDiffOn (hf.comp x hG.contDiffAt) hx] at hc
30
+ norm_num only [Nat.factorial] at hc
31
+ exact hc
32
+
33
+ theorem coulomb_kernel_jets_near_bound :
34
+ ∃ C : ℝ, 1 ≤ C ∧ ∀ (z : Position) (r : ℝ), 0 < r → r ≤ 1 → r ≤ ‖z‖ →
35
+ ∀ k : ℕ, k ≤ 4 → ‖iteratedFDeriv ℝ k Coulomb.coulombKernel z‖ ≤ C/r^5 := by
36
+ obtain ⟨C,hC,hbound⟩ := coulombKernel_derivative_decay
37
+ refine ⟨C,hC,fun z r hr hr1 hz k hk => ?_⟩
38
+ have hzne : z ≠ 0 := norm_pos_iff.mp (hr.trans_le hz)
39
+ have hb := hbound ⟨k,by omega⟩ z hzne
40
+ apply (le_div_iff₀ (pow_pos hr 5)).mpr
41
+ have hp : r^5 ≤ ‖z‖^(k+1) := by
42
+ calc
43
+ _ ≤ r^(k+1) := pow_le_pow_of_le_one hr.le hr1 (by omega)
44
+ _ ≤ _ := pow_le_pow_left₀ hr.le hz _
45
+ exact (mul_le_mul_of_nonneg_left hp (norm_nonneg _)).trans hb
46
+
47
+ theorem transportedCoulomb_fourth_bound :
48
+ ∃ C : ℝ, 1 ≤ C ∧ ∀ (G : Position → Position), ContDiff ℝ 4 G →
49
+ ∀ (y x : Position) (r D : ℝ), 0 < r → r ≤ 1 → r ≤ ‖y-G x‖ →
50
+ (∀ k : ℕ, 1 ≤ k → k ≤ 4 → ‖iteratedFDeriv ℝ k G x‖ ≤ D^k) →
51
+ ‖iteratedFDeriv ℝ 4 (fun b => Coulomb.coulombKernel (y-G b)) x‖ ≤ 24*C*D^4/r^5 := by
52
+ obtain ⟨C,hC,hbound⟩ := coulomb_kernel_jets_near_bound
53
+ refine ⟨C,hC,fun G hG y x r D hr hr1 hdist hD => ?_⟩
54
+ have hne : y-G x ≠ 0 := norm_pos_iff.mp (hr.trans_le hdist)
55
+ have hf : ContDiffAt ℝ 4 (fun z => Coulomb.coulombKernel (y-z)) (G x) :=
56
+ ((coulombKernel_contDiffAt hne).of_le
57
+ (ENat.natCast_le_of_coe_top_le_withTop le_rfl 4)).comp (G x) (contDiffAt_const.sub contDiffAt_id)
58
+ have hb := fourth_composite_norm_bound (fun z => Coulomb.coulombKernel (y-z)) G x hf hG
59
+ (fun k hk => by rw [translatedCoulomb_derivative_norm]; exact hbound _ r hr hr1 hdist k hk) hD
60
+ apply hb.trans_eq
61
+ ring
62
+
63
+ theorem transportedCoulomb_cell_error :
64
+ ∃ C : ℝ, 1 ≤ C ∧ ∀ (G : Position → Position), ContDiff ℝ 4 G →
65
+ ∀ (y b : Position) (h r D : ℝ), 0 ≤ h → 0 < r → r ≤ 1 →
66
+ (∀ x ∈ Set.Icc (-1:ℝ) 1, ∀ v ∈ Set.Icc (-1:ℝ) 1,
67
+ ∀ z ∈ Set.Icc (-1:ℝ) 1, r ≤ ‖y-G (cubePoint b (h/2) x v z)‖) →
68
+ (∀ x ∈ Set.Icc (-1:ℝ) 1, ∀ v ∈ Set.Icc (-1:ℝ) 1,
69
+ ∀ z ∈ Set.Icc (-1:ℝ) 1, ∀ k : ℕ, 1 ≤ k → k ≤ 4 →
70
+ ‖iteratedFDeriv ℝ k G (cubePoint b (h/2) x v z)‖ ≤ D^k) →
71
+ |positionCellGauss b h (fun a => Coulomb.coulombKernel (y-G a))-
72
+ positionCellIntegral b h (fun a => Coulomb.coulombKernel (y-G a))| ≤
73
+ 24*C*D^4*h^7/r^5 := by
74
+ obtain ⟨C,hC,hbound⟩ := transportedCoulomb_fourth_bound
75
+ refine ⟨C,hC,fun G hG y b h r D hh hr hr1 hdist hD => ?_⟩
76
+ have hf (x : ℝ) (hx : x ∈ Set.Icc (-1:ℝ) 1) (v : ℝ) (hv : v ∈ Set.Icc (-1:ℝ) 1)
77
+ (z : ℝ) (hz : z ∈ Set.Icc (-1:ℝ) 1) :
78
+ ContDiffAt ℝ 4 (fun a => Coulomb.coulombKernel (y-G a)) (cubePoint b (h/2) x v z) := by
79
+ have hn : y-G (cubePoint b (h/2) x v z) ≠ 0 :=
80
+ norm_pos_iff.mp (hr.trans_le (hdist x hx v hv z hz))
81
+ have hi : ContDiffAt ℝ 4 (fun a => y-G a) (cubePoint b (h/2) x v z) :=
82
+ contDiffAt_const.sub hG.contDiffAt
83
+ exact ContDiffAt.comp (g := Coulomb.coulombKernel) (f := fun a : Position => y-G a)
84
+ (cubePoint b (h/2) x v z) ((coulombKernel_contDiffAt hn).of_le
85
+ (ENat.natCast_le_of_coe_top_le_withTop le_rfl 4)) hi
86
+ have hC0 : 0 ≤ C := le_trans (by norm_num) hC
87
+ have he := positionCellGauss_error_local (fun a => Coulomb.coulombKernel (y-G a)) b hh
88
+ (by positivity : 0 ≤ 24*C*D^4/r^5) hf
89
+ (fun x hx v hv z hz => hbound G hG y _ r D hr hr1 (hdist x hx v hv z hz) (hD x hx v hv z hz))
90
+ apply he.trans_eq
91
+ ring
92
+
93
+ end ContinuumCoulomb
94
+
95
+ end
96
+
97
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedFarQuadrature.lean ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedGrid
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedHybrid
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.GaussGrid
4
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ExceptionalCellVolume
5
+
6
+ namespace OAI
7
+
8
+ /-! Local fourth-order error with the nondecaying transport correction
9
+ charged only to cells meeting the compact well support. -/
10
+
11
+ noncomputable section
12
+ open MeasureTheory
13
+ open scoped BigOperators Classical NNReal
14
+ namespace ContinuumCoulomb
15
+
16
+ def cellHits (E : Set Position) (b : Position) (h : ℝ) : ℝ :=
17
+ if ∃ z ∈ positionCube b h, z ∈ E then 1 else 0
18
+
19
+ theorem cellHits_nonneg (E : Set Position) (b : Position) (h : ℝ) : 0 ≤ cellHits E b h := by
20
+ unfold cellHits
21
+ split_ifs <;> norm_num
22
+
23
+ theorem cellHits_indicator_le (E : Set Position) (b : Position) (h : ℝ)
24
+ {x : Position} (hx : x ∈ positionCube b h) :
25
+ (if x ∈ E then (1:ℝ) else 0) ≤ cellHits E b h := by
26
+ by_cases hE : x ∈ E
27
+ · simp [hE,cellHits,show ∃ z ∈ positionCube b h, z ∈ E from ⟨x,hx,hE⟩]
28
+ · simpa only [ite_eq_right hE] using cellHits_nonneg E b h
29
+
30
+ theorem manufactured_cellHits_volume_bound {ι : Type*} [Fintype ι]
31
+ (index : ι → Fin 3 → ℤ) (hindex : Function.Injective index)
32
+ {h S : ℝ} (hh : 0 < h) (hh1 : h ≤ 1) (hS : 1 ≤ S)
33
+ (freq scale : ℝ) {m : ℕ} (u : Fin m → PlanarPosition) :
34
+ (∑ i, cellHits (tsupport (manufacturedWellField freq scale S u))
35
+ (gaussCellCenter h (index i)) h*h^3) ≤ 216*m*S := by
36
+ let s := Finset.univ.filter (fun i => ∃ z ∈ positionCube (gaussCellCenter h (index i)) h,
37
+ z ∈ tsupport (manufacturedWellField freq scale S u))
38
+ have hi : Function.Injective (fun i : {i // i ∈ s} => index i.val) := by
39
+ intro i j hij
40
+ exact Subtype.ext (hindex hij)
41
+ have he := exceptional_cell_volume_bound (fun i : {i // i ∈ s} => index i.val) hi
42
+ hh hh1 hS freq scale u (fun i => (Finset.mem_filter.mp i.property).2)
43
+ simpa only [Fintype.card_coe,s,cellHits,ite_mul,one_mul,zero_mul,← Finset.sum_filter,
44
+ Finset.sum_const,nsmul_eq_mul] using he
45
+
46
+ theorem transportedCoulomb_far_cell_hybrid_error :
47
+ ∃ C : ℝ, 1 ≤ C ∧ ∀ (G : Position → Position), ContDiff ℝ 4 G →
48
+ ∀ (E : Set Position), IsClosed E → (∀ x, x ∉ E → G x = x) →
49
+ ∀ (D : ℝ), 1 ≤ D →
50
+ (∀ x, ∀ k : ℕ, 1 ≤ k → k ≤ 4 → ‖iteratedFDeriv ℝ k G x‖ ≤ D^k) →
51
+ ∀ (L : ℝ≥0), 0 < L → LipschitzWith L G →
52
+ ∀ (y b : Position) (h : ℝ), 0 < h → 4*(L:ℝ)*h ≤ ‖y-G b‖ →
53
+ |positionCellGauss b h (fun x => Coulomb.coulombKernel (y-G x))-
54
+ positionCellIntegral b h (fun x => Coulomb.coulombKernel (y-G x))| ≤
55
+ (24*C*D^4)*(32/‖y-G b‖^5+cellHits E b h)*h^7 := by
56
+ obtain ⟨C,hC,hbound⟩ := transportedCoulomb_hybrid_fourth_bound
57
+ refine ⟨C,hC,fun G hG E hE hfix D hD hGD L hL hLip y b h hh hfar => ?_⟩
58
+ have hC0 : 0 ≤ C := (by norm_num : (0:ℝ) ≤ 1).trans hC
59
+ have hd : 0 < ‖y-G b‖ := lt_of_lt_of_le (by positivity) hfar
60
+ have hf (x : ℝ) (hx : x ∈ Set.Icc (-1:ℝ) 1) (v : ℝ) (hv : v ∈ Set.Icc (-1:ℝ) 1)
61
+ (z : ℝ) (hz : z ∈ Set.Icc (-1:ℝ) 1) :
62
+ ContDiffAt ℝ 4 (fun a => Coulomb.coulombKernel (y-G a)) (cubePoint b (h/2) x v z) := by
63
+ have hc := cubePoint_mem_positionCube b hh.le hx hv hz
64
+ have hn := (transported_far_cube_distances hh G hL hLip hfar hc).1
65
+ have hne : y-G (cubePoint b (h/2) x v z) ≠ 0 :=
66
+ norm_pos_iff.mp (lt_of_lt_of_le (by positivity : (0:ℝ) < (L:ℝ)*h) hn.le)
67
+ exact ContDiffAt.comp (g := Coulomb.coulombKernel) (f := fun a : Position => y-G a)
68
+ _ ((coulombKernel_contDiffAt hne).of_le
69
+ (ENat.natCast_le_of_coe_top_le_withTop le_rfl 4)) (contDiffAt_const.sub hG.contDiffAt)
70
+ apply positionCellGauss_error_local _ b hh.le
71
+ (mul_nonneg (by positivity) (add_nonneg (by positivity) (cellHits_nonneg E b h))) hf
72
+ intro x hx v hv z hz
73
+ let a := cubePoint b (h/2) x v z
74
+ have hc : a ∈ positionCube b h := cubePoint_mem_positionCube b hh.le hx hv hz
75
+ have ha := transported_far_cube_distances hh G hL hLip hfar hc
76
+ have hapos : 0 < ‖y-G a‖ := lt_of_lt_of_le (by positivity : (0:ℝ) < (L:ℝ)*h) ha.1.le
77
+ have hp : 1/‖y-G a‖^5 ≤ 32/‖y-G b‖^5 := by
78
+ have he := one_div_le_one_div_of_le (pow_pos (by positivity : 0 < ‖y-G b‖/2) 5)
79
+ (pow_le_pow_left₀ (by positivity : 0 ≤ ‖y-G b‖/2) ha.2.1 5)
80
+ apply he.trans_eq
81
+ field_simp
82
+ norm_num
83
+ apply (hbound G hG E hE hfix D hD hGD y a (norm_pos_iff.mp hapos)).trans
84
+ exact mul_le_mul_of_nonneg_left (add_le_add hp (cellHits_indicator_le E b h hc)) (by positivity)
85
+
86
+ theorem transportedCoulomb_far_grid_hybrid_error :
87
+ ∃ C : ℝ, 1 ≤ C ∧ ∀ (G : Position → Position), ContDiff ℝ 4 G →
88
+ ∀ (E : Set Position), IsClosed E → (∀ x, x ∉ E → G x = x) →
89
+ ∀ (D : ℝ), 1 ≤ D →
90
+ (∀ x, ∀ k : ℕ, 1 ≤ k �� k ≤ 4 → ‖iteratedFDeriv ℝ k G x‖ ≤ D^k) →
91
+ ∀ (L : ℝ≥0), 0 < L → LipschitzWith L G →
92
+ ∀ {ι : Type} [Fintype ι] (index : ι → Fin 3 → ℤ)
93
+ (y : Position) (h : ℝ), 0 < h →
94
+ (∀ i, 4*(L:ℝ)*h ≤ ‖y-G (gaussCellCenter h (index i))‖) →
95
+ |(∑ i, positionCellGauss (gaussCellCenter h (index i)) h
96
+ (fun x => Coulomb.coulombKernel (y-G x)))-
97
+ (∑ i, positionCellIntegral (gaussCellCenter h (index i)) h
98
+ (fun x => Coulomb.coulombKernel (y-G x)))| ≤
99
+ 24*C*D^4*h^4*(32*(∑ i, h^3/‖y-G (gaussCellCenter h (index i))‖^5)+
100
+ ∑ i, cellHits E (gaussCellCenter h (index i)) h*h^3) := by
101
+ obtain ⟨C,hC,hbound⟩ := transportedCoulomb_far_cell_hybrid_error
102
+ refine ⟨C,hC,?_⟩
103
+ intro G hG E hE hfix D hD hGD L hL hLip ι _ index y h hh hfar
104
+ have he := weighted_cubature_error h 1
105
+ (fun i => positionCellGauss (gaussCellCenter h (index i)) h
106
+ (fun x => Coulomb.coulombKernel (y-G x)))
107
+ (fun i => positionCellIntegral (gaussCellCenter h (index i)) h
108
+ (fun x => Coulomb.coulombKernel (y-G x)))
109
+ (fun i => 24*C*D^4*(32/‖y-G (gaussCellCenter h (index i))‖^5+
110
+ cellHits E (gaussCellCenter h (index i)) h))
111
+ zero_le_one (fun i => hbound G hG E hE hfix D hD hGD L hL hLip y _ h hh (hfar i))
112
+ simp only [one_mul] at he
113
+ apply he.trans_eq
114
+ have hs : (∑ i, (24*C*D^4*(32/‖y-G (gaussCellCenter h (index i))‖^5+
115
+ cellHits E (gaussCellCenter h (index i)) h))*h^3) =
116
+ (24*C*D^4)*(32*(∑ i, h^3/‖y-G (gaussCellCenter h (index i))‖^5)+
117
+ ∑ i, cellHits E (gaussCellCenter h (index i)) h*h^3) := by
118
+ calc
119
+ _ = ∑ i, (24*C*D^4)*(32*(h^3/‖y-G (gaussCellCenter h (index i))‖^5)+
120
+ cellHits E (gaussCellCenter h (index i)) h*h^3) := by
121
+ apply Finset.sum_congr rfl
122
+ intro i _
123
+ ring
124
+ _ = _ := by rw [← Finset.mul_sum,Finset.sum_add_distrib,← Finset.mul_sum]
125
+ rw [hs]
126
+ ring
127
+
128
+ end ContinuumCoulomb
129
+
130
+ end
131
+
132
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedGrid.lean ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CubeGeometry
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserIntegralBound
3
+
4
+ namespace OAI
5
+
6
+ /-! The far-cell inverse-fifth sum after the actual density transport.
7
+ Its constant does not depend on the slab's horizontal extent. -/
8
+
9
+ noncomputable section
10
+ open MeasureTheory
11
+ open scoped BigOperators NNReal
12
+ namespace ContinuumCoulomb
13
+
14
+ theorem transported_far_cube_distances {h : ℝ} (hh : 0 < h)
15
+ (G : Position → Position) {L : ℝ≥0} (hL : 0 < L) (hG : LipschitzWith L G)
16
+ {y b x : Position} (hfar : 4*(L:ℝ)*h ≤ ‖y-G b‖) (hx : x ∈ positionCube b h) :
17
+ (L:ℝ)*h < ‖y-G x‖ ∧ ‖y-G b‖/2 ≤ ‖y-G x‖ ∧ ‖y-G x‖ ≤ 2*‖y-G b‖ := by
18
+ have hhL : 0 < (L:ℝ)*h := mul_pos (by exact_mod_cast hL) hh
19
+ have hn : ‖G x-G b‖ ≤ (L:ℝ)*h :=
20
+ (hG.norm_sub_le x b).trans (mul_le_mul_of_nonneg_left
21
+ (positionCube_norm_sub_le hh.le hx) L.coe_nonneg)
22
+ have ha := norm_sub_le_norm_sub_add_norm_sub y (G x) (G b)
23
+ have hb := norm_sub_le_norm_sub_add_norm_sub y (G b) (G x)
24
+ rw [norm_sub_rev (G b) (G x)] at hb
25
+ constructor
26
+ · nlinarith
27
+ constructor <;> nlinarith
28
+
29
+ theorem transported_inverseFifth_far_cube_bound {h : ℝ} (hh : 0 < h)
30
+ (G : Position → Position) {L : ℝ≥0} (hL : 0 < L) (hG : LipschitzWith L G)
31
+ (y b : Position) (hfar : 4*(L:ℝ)*h ≤ ‖y-G b‖) :
32
+ h^3/‖y-G b‖^5 ≤
33
+ 32*(∫ x in positionCube b h, inverseFifthTail ((L:ℝ)*h) (y-G x)) := by
34
+ have hr : 0 < (L:ℝ)*h := mul_pos (by exact_mod_cast hL) hh
35
+ have hd : 0 < ‖y-G b‖ := lt_of_lt_of_le (by positivity) hfar
36
+ have hi : IntegrableOn (fun x => inverseFifthTail ((L:ℝ)*h) (y-G x)) (positionCube b h) := by
37
+ apply IntegrableOn.of_bound (positionCube_isCompact b hh.le).measure_lt_top
38
+ (((inverseFifthTail_measurable _).comp (continuous_const.sub hG.continuous).measurable).aestronglyMeasurable.restrict)
39
+ (1/((L:ℝ)*h)^5)
40
+ exact Filter.Eventually.of_forall (fun x => by
41
+ change ‖inverseFifthTail ((L:ℝ)*h) (y-G x)‖ ≤ 1/((L:ℝ)*h)^5
42
+ rw [Real.norm_of_nonneg (inverseFifthTail_nonneg _ _)]
43
+ exact inverseFifthTail_le hr _)
44
+ have hp (x : Position) (hx : x ∈ positionCube b h) :
45
+ 1/‖y-G b‖^5 ≤ 32*inverseFifthTail ((L:ℝ)*h) (y-G x) := by
46
+ obtain ⟨hxgt,_hxl,hxu⟩ := transported_far_cube_distances hh G hL hG hfar hx
47
+ have hdx := hr.trans hxgt
48
+ rw [inverseFifthTail_eq_inv_pow _ hxgt,mul_one_div]
49
+ apply (div_le_div_iff₀ (pow_pos hd 5) (pow_pos hdx 5)).mpr
50
+ have hb := pow_le_pow_left₀ (norm_nonneg (y-G x)) hxu 5
51
+ nlinarith [show (2*‖y-G b‖)^5 = 32*‖y-G b‖^5 by ring]
52
+ have he := setIntegral_mono_on
53
+ (integrableOn_const (C := 1/‖y-G b‖^5)
54
+ ((positionCube_isCompact b hh.le).measure_lt_top (μ := volume)).ne)
55
+ (hi.const_mul 32) (positionCube_isClosed b h).measurableSet hp
56
+ have hv : (volume.restrict (positionCube b h)).real Set.univ = h^3 := by
57
+ simpa only [Measure.real,Measure.restrict_apply_univ] using positionCube_volume b hh.le
58
+ simpa only [integral_const,smul_eq_mul,hv,integral_const_mul,div_eq_mul_inv,mul_one,one_mul] using he
59
+
60
+ theorem moser_inverseFifth_grid_sum_bound (hpublished : PublishedC4FlowInput)
61
+ {rho H S : ℝ} (hrho : 0 < rho) (hH : 0 ≤ H) (hS : 0 ≤ S)
62
+ (V : Position → ℝ) (hV : ContDiff ℝ 6 V)
63
+ (hbound : ∀ x, |manufacturedCharge V x| ≤ rho/2)
64
+ (hsupport : tsupport V ⊆ slabDomain H S)
65
+ (G : Position → ℝ → Position) (hG : IsUnitTimeFlow (moserVelocity rho V) G)
66
+ (hbij : Function.Bijective (fun x => G x 1))
67
+ (hfix : ∀ x, x ∉ tsupport V → G x 1 = x)
68
+ {L : ℝ≥0} (hL : 0 < L) (hLip : LipschitzWith L (fun x => G x 1))
69
+ {ι : Type*} [Fintype ι] (index : ι → Fin 3 → ℤ) (hindex : Function.Injective index)
70
+ {h : ℝ} (hh : 0 < h)
71
+ (hsub : ∀ i, positionCube (gaussCellCenter h (index i)) h ⊆ slabDomain H S)
72
+ (y : Position) (hfar : ∀ i, 4*(L:ℝ)*h ≤ ‖y-G (gaussCellCenter h (index i)) 1‖) :
73
+ (∑ i, h^3/‖y-G (gaussCellCenter h (index i)) 1‖^5) ≤ 96*Real.pi/((L:ℝ)*h)^2 := by
74
+ have hr : 0 < (L:ℝ)*h := mul_pos (by exact_mod_cast hL) hh
75
+ calc
76
+ _ ≤ ∑ i, 32*(∫ x in positionCube (gaussCellCenter h (index i)) h,
77
+ inverseFifthTail ((L:ℝ)*h) (y-G x 1)) :=
78
+ Finset.sum_le_sum (fun i _ => transported_inverseFifth_far_cube_bound hh
79
+ (fun x => G x 1) hL hLip y _ (hfar i))
80
+ _ = 32*(∑ i, ∫ x in positionCube (gaussCellCenter h (index i)) h,
81
+ inverseFifthTail ((L:ℝ)*h) (y-G x 1)) := (Finset.mul_sum _ _ _).symm
82
+ _ ≤ 32*(∫ x in slabDomain H S, inverseFifthTail ((L:ℝ)*h) (y-G x 1)) :=
83
+ mul_le_mul_of_nonneg_left (grid_cell_integral_sum_le_on index hindex hh hsub _
84
+ (transportedInverseFifth_integrableOn hH hS hr _ hLip.continuous y)
85
+ (fun x => inverseFifthTail_nonneg _ _)) (by norm_num)
86
+ _ ≤ 32*(3*Real.pi/((L:ℝ)*h)^2) := mul_le_mul_of_nonneg_left
87
+ (moser_inverseFifth_tail_bound hpublished hrho V hV hbound hsupport G hG hbij hfix y hr)
88
+ (by norm_num)
89
+ _ = _ := by ring
90
+
91
+ end ContinuumCoulomb
92
+
93
+ end
94
+
95
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedHybrid.lean ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedCoulombDerivative
2
+
3
+ namespace OAI
4
+
5
+ /-! The transport correction is confined to the support of the field. Outside
6
+ that set only the integrable inverse-fifth Coulomb derivative remains. -/
7
+
8
+ noncomputable section
9
+ open Filter
10
+ open scoped Topology Classical
11
+ namespace ContinuumCoulomb
12
+
13
+ theorem coulomb_kernel_jets_hybrid_bound :
14
+ ∃ C : ℝ, 1 ≤ C ∧
15
+ (∀ (z : Position), z ≠ 0 → ∀ k : ℕ, k ≤ 4 →
16
+ ‖iteratedFDeriv ℝ k Coulomb.coulombKernel z‖ ≤ C*(1+1/‖z‖^5)) ∧
17
+ (∀ (z : Position), z ≠ 0 →
18
+ ‖iteratedFDeriv ℝ 4 Coulomb.coulombKernel z‖ ≤ C/‖z‖^5) := by
19
+ obtain ⟨C,hC,hbound⟩ := coulombKernel_derivative_decay
20
+ have hC0 : 0 ≤ C := (by norm_num : (0:ℝ) ≤ 1).trans hC
21
+ refine ⟨C,hC,?_,?_⟩
22
+ · intro z hz k hk
23
+ have hd : 0 < ‖z‖ := norm_pos_iff.mpr hz
24
+ have hb := hbound ⟨k,by omega⟩ z hz
25
+ by_cases hd1 : ‖z‖ ≤ 1
26
+ · have hp : ‖z‖^5 ≤ ‖z‖^(k+1) :=
27
+ pow_le_pow_of_le_one hd.le hd1 (by omega)
28
+ have he : ‖iteratedFDeriv ℝ k Coulomb.coulombKernel z‖ ≤ C/‖z‖^5 := by
29
+ apply (le_div_iff₀ (pow_pos hd 5)).mpr
30
+ exact (mul_le_mul_of_nonneg_left hp (norm_nonneg _)).trans hb
31
+ rw [mul_add,mul_one,mul_one_div]
32
+ linarith
33
+ · have hp : 1 ≤ ‖z‖^(k+1) := one_le_pow₀ (le_of_not_ge hd1)
34
+ have hm : ‖iteratedFDeriv ℝ k Coulomb.coulombKernel z‖ ≤
35
+ ‖iteratedFDeriv ℝ k Coulomb.coulombKernel z‖*‖z‖^(k+1) := by
36
+ simpa only [mul_one] using
37
+ mul_le_mul_of_nonneg_left hp (norm_nonneg (iteratedFDeriv ℝ k Coulomb.coulombKernel z))
38
+ have he := hm.trans hb
39
+ rw [mul_add,mul_one,mul_one_div]
40
+ linarith [div_nonneg hC0 (pow_nonneg hd.le 5)]
41
+ · intro z hz
42
+ apply (le_div_iff₀ (pow_pos (norm_pos_iff.mpr hz) 5)).mpr
43
+ exact hbound (4:Fin 5) z hz
44
+
45
+ theorem transportedCoulomb_hybrid_fourth_bound :
46
+ ∃ C : ℝ, 1 ≤ C ∧ ∀ (G : Position → Position), ContDiff ℝ 4 G →
47
+ ∀ (E : Set Position), IsClosed E → (∀ x, x ∉ E → G x = x) →
48
+ ∀ (D : ℝ), 1 ≤ D →
49
+ (∀ x, ∀ k : ℕ, 1 ≤ k → k ≤ 4 → ‖iteratedFDeriv ℝ k G x‖ ≤ D^k) →
50
+ ∀ (y x : Position), y-G x ≠ 0 →
51
+ ‖iteratedFDeriv ℝ 4 (fun b => Coulomb.coulombKernel (y-G b)) x‖ ≤
52
+ 24*C*D^4*(1/‖y-G x‖^5 + if x ∈ E then 1 else 0) := by
53
+ classical
54
+ obtain ⟨C,hC,hbound,hpure⟩ := coulomb_kernel_jets_hybrid_bound
55
+ refine ⟨C,hC,fun G hG E hE hfix D hD hGD y x hne => ?_⟩
56
+ have hC0 : 0 ≤ C := (by norm_num : (0:ℝ) ≤ 1).trans hC
57
+ have hf : ContDiffAt ℝ 4 (fun z => Coulomb.coulombKernel (y-z)) (G x) :=
58
+ ((coulombKernel_contDiffAt hne).of_le
59
+ (ENat.natCast_le_of_coe_top_le_withTop le_rfl 4)).comp (G x)
60
+ (contDiffAt_const.sub contDiffAt_id)
61
+ by_cases hx : x ∈ E
62
+ · have he := fourth_composite_norm_bound (fun z => Coulomb.coulombKernel (y-z)) G x hf hG
63
+ (fun k hk => by rw [translatedCoulomb_derivative_norm]; exact hbound _ hne k hk)
64
+ (hGD x)
65
+ simp only [ite_eq_left hx]
66
+ apply he.trans_eq
67
+ ring
68
+ · have hlocal : G =ᶠ[𝓝 x] id := by
69
+ filter_upwards [hE.isOpen_compl.mem_nhds hx] with z hz
70
+ exact hfix z hz
71
+ have heq : (fun b => Coulomb.coulombKernel (y-G b)) =ᶠ[𝓝 x]
72
+ (fun b => Coulomb.coulombKernel (y-b)) := by
73
+ filter_upwards [hlocal] with b hb
74
+ rw [hb]
75
+ rfl
76
+ rw [(heq.iteratedFDeriv ℝ 4).eq_of_nhds,translatedCoulomb_derivative_norm]
77
+ have he := hpure (y-x) (by simpa only [hfix x hx] using hne)
78
+ have hfac : C ≤ 24*C*D^4 := by nlinarith [one_le_pow₀ hD (n := 4)]
79
+ simp only [ite_eq_right hx,add_zero,hfix x hx]
80
+ exact he.trans (by simpa only [div_eq_mul_inv,mul_one,one_mul] using
81
+ mul_le_mul_of_nonneg_right hfac (inv_nonneg.mpr (pow_nonneg (norm_nonneg (y-x)) 5)))
82
+
83
+ end ContinuumCoulomb
84
+
85
+ end
86
+
87
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedNearForm.lean ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ScaledNuclearNear
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedNodes
3
+
4
+ namespace OAI
5
+
6
+ /-! The actual transported Gauss nuclei satisfy the separation hypothesis
7
+ in the full weak-H1 near-field bound, uniformly over the chosen finite grid. -/
8
+
9
+ noncomputable section
10
+ open MeasureTheory
11
+ open scoped BigOperators NNReal
12
+ namespace ContinuumCoulomb
13
+
14
+ theorem transportedGauss_separation {m : ℕ} {h : ℝ} (hh : 0 < h)
15
+ (index : Fin m → GaussLatticeIndex) (hindex : Function.Injective index)
16
+ (G : Position → Position) {K : ℝ≥0} (hK : 0 < K) (hG : AntilipschitzWith K G)
17
+ (a b : Fin m) (hab : a ≠ b) :
18
+ h/(3*(K:ℝ)) ≤ ‖G (gaussLatticePoint h (index a))-G (gaussLatticePoint h (index b))‖ := by
19
+ have hb := gaussLatticePoint_separation hh (index a) (index b) (fun he => hab (hindex he))
20
+ have ht := hG.le_mul_dist (gaussLatticePoint h (index a)) (gaussLatticePoint h (index b))
21
+ simp only [dist_eq_norm] at ht
22
+ apply (div_le_iff₀ (show 0 < 3*(K:ℝ) by positivity)).mpr
23
+ nlinarith
24
+
25
+ theorem transportedGauss_near_form {κ : ℝ} (hκ : 0 < κ)
26
+ (K : ℝ≥0) (hK : 0 < K) :
27
+ ∃ A : ℝ, 1 ≤ A ∧ ∀ (m n : ℕ) (u : Coulomb.H1Vector n)
28
+ (s : SpinConfiguration n) (i : Fin n) (h ρ : ℝ),
29
+ 0 < h → h ≤ 1 → 0 ≤ ρ →
30
+ ∀ (index : Fin m → GaussLatticeIndex), Function.Injective index →
31
+ ∀ (G : Position → Position), AntilipschitzWith K G →
32
+ (ρ*h^3/8)*(∑ a, ∫ x in electronBall i (G (gaussLatticePoint h (index a))) (κ*h),
33
+ Coulomb.coulombKernel (Coulomb.position x i-G (gaussLatticePoint h (index a)))*
34
+ ‖u.value s x‖^2) ≤
35
+ ρ*A*h^2*((∫ x, ‖u.value s x‖^2)+
36
+ ∑ k : Fin 3, ∫ x, ‖u.gradient s (i,k) x‖^2) := by
37
+ have hσ : 0 < 1/(3*(K:ℝ)) := by positivity
38
+ obtain ⟨A,hA,hbound⟩ := scaled_nuclear_near_bound hκ hσ
39
+ refine ⟨A,hA,fun m n u s i h ρ hh hh1 hρ index hindex G hG => ?_⟩
40
+ apply hbound m n u s i (fun a => G (gaussLatticePoint h (index a))) h ρ hh hh1 hρ
41
+ intro a b hab
42
+ have he := transportedGauss_separation hh index hindex G hK hG a b hab
43
+ convert he using 1
44
+ ring
45
+
46
+ end ContinuumCoulomb
47
+
48
+ end
49
+
50
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedNearGrid.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserIntegrability
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CubeIntegral
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.TransportedGrid
4
+
5
+ namespace OAI
6
+
7
+ /-! Near cells have uniformly bounded continuous Coulomb mass after the
8
+ actual Moser transport. The bound is independent of the enclosing box. -/
9
+
10
+ noncomputable section
11
+ open MeasureTheory
12
+ open scoped BigOperators NNReal
13
+ namespace ContinuumCoulomb
14
+
15
+ theorem transported_near_cube_distance {h : ℝ} (hh : 0 < h)
16
+ (G : Position → Position) {L : ℝ≥0} (hL : 0 < L) (hG : LipschitzWith L G)
17
+ {y b x : Position} (hnear : ‖y-G b‖ ≤ 4*(L:ℝ)*h) (hx : x ∈ positionCube b h) :
18
+ ‖y-G x‖ < 6*(L:ℝ)*h := by
19
+ have hn : ‖G x-G b‖ ≤ (L:ℝ)*h :=
20
+ (hG.norm_sub_le x b).trans (mul_le_mul_of_nonneg_left
21
+ (positionCube_norm_sub_le hh.le hx) L.coe_nonneg)
22
+ have ht := norm_sub_le_norm_sub_add_norm_sub y (G b) (G x)
23
+ rw [norm_sub_rev (G b) (G x)] at ht
24
+ have hp : 0 < (L:ℝ)*h := mul_pos (by exact_mod_cast hL) hh
25
+ linarith
26
+
27
+ theorem transported_near_kernel_eq {h : ℝ} (hh : 0 < h)
28
+ (G : Position → Position) {L : ℝ≥0} (hL : 0 < L) (hG : LipschitzWith L G)
29
+ {y b x : Position} (hnear : ‖y-G b‖ ≤ 4*(L:ℝ)*h) (hx : x ∈ positionCube b h) :
30
+ Coulomb.coulombKernel (y-G x) = Coulomb.truncatedCoulomb (6*(L:ℝ)*h) (y-G x) := by
31
+ have hm : y-G x ∈ Metric.ball (0:Position) (6*(L:ℝ)*h) := by
32
+ simpa only [Metric.mem_ball,dist_zero_right] using
33
+ transported_near_cube_distance hh G hL hG hnear hx
34
+ exact (Set.indicator_of_mem hm _).symm
35
+
36
+ theorem moser_near_grid_integral_bound (hpublished : PublishedC4FlowInput)
37
+ {rho H S : ℝ} (hrho : 0 < rho) (hH : 0 ≤ H) (hS : 0 ≤ S)
38
+ (V : Position → ℝ) (hV : ContDiff ℝ 6 V)
39
+ (hbound : ∀ x, |manufacturedCharge V x| ≤ rho/2)
40
+ (hsupport : tsupport V ⊆ slabDomain H S)
41
+ (G : Position → ℝ → Position) (hG : IsUnitTimeFlow (moserVelocity rho V) G)
42
+ (hbij : Function.Bijective (fun x => G x 1))
43
+ (hfix : ∀ x, x ∉ tsupport V → G x 1 = x)
44
+ {L : ℝ≥0} (hL : 0 < L) (hLip : LipschitzWith L (fun x => G x 1))
45
+ {ι : Type*} [Fintype ι] (index : ι → Fin 3 → ℤ) (hindex : Function.Injective index)
46
+ {h : ℝ} (hh : 0 < h)
47
+ (hsub : ∀ i, positionCube (gaussCellCenter h (index i)) h ⊆ slabDomain H S)
48
+ (y : Position) (hnear : ∀ i, ‖y-G (gaussCellCenter h (index i)) 1‖ ≤ 4*(L:ℝ)*h) :
49
+ (∑ i, positionCellIntegral (gaussCellCenter h (index i)) h
50
+ (fun x => Coulomb.coulombKernel (y-G x 1))) ≤ 108*Real.pi*(L:ℝ)^2*h^2 := by
51
+ have hi := moser_coulomb_integrableOn hpublished hrho hH hS V hV hbound hsupport G hG hbij hfix y
52
+ have ht := moser_truncatedCoulomb_integrable hpublished hrho V hV hbound hsupport
53
+ G hG hbij hfix y (6*(L:ℝ)*h)
54
+ calc
55
+ _ = ∑ i, ∫ x in positionCube (gaussCellCenter h (index i)) h,
56
+ Coulomb.truncatedCoulomb (6*(L:ℝ)*h) (y-G x 1) := by
57
+ apply Finset.sum_congr rfl
58
+ intro i _
59
+ rw [positionCellIntegral_eq_setIntegral _ hh.le _ (hi.mono_set (hsub i))]
60
+ apply setIntegral_congr_fun (positionCube_isClosed _ _).measurableSet
61
+ intro x hx
62
+ exact transported_near_kernel_eq hh (fun x => G x 1) hL hLip (hnear i) hx
63
+ _ ≤ ∫ x in slabDomain H S, Coulomb.truncatedCoulomb (6*(L:ℝ)*h) (y-G x 1) :=
64
+ grid_cell_integral_sum_le_on index hindex hh hsub _ ht
65
+ (fun x => Coulomb.truncatedCoulomb_nonneg _ _)
66
+ _ ≤ 3*Real.pi*(6*(L:ℝ)*h)^2 :=
67
+ moser_truncatedCoulomb_bound hpublished hrho V hV hbound hsupport G hG hbij hfix y (by positivity)
68
+ _ = _ := by ring
69
+
70
+ end ContinuumCoulomb
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/Nuclei/TransportedNodes.lean ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.MoserInverse
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.Cubature
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearCoordinates
4
+
5
+ namespace OAI
6
+
7
+ /-! The actual tensor Gauss nodes on a cubic lattice are separated before
8
+ transport, after transport, and after rational rounding. The enclosing finite
9
+ set of cells will determine the nucleus count in the final construction. -/
10
+
11
+ noncomputable section
12
+ open scoped NNReal
13
+ namespace ContinuumCoulomb
14
+
15
+ abbrev GaussLatticeIndex := (Fin 3 → ℤ) × (Fin 3 → Fin 2)
16
+
17
+ def gaussLatticePoint (h : ℝ) (i : GaussLatticeIndex) : Position :=
18
+ WithLp.toLp 2 (fun a => h * ((i.1 a : ℝ) + gaussNode (i.2 a) / 2))
19
+
20
+ theorem gaussAbscissa_bounds : (1 / 2 : ℝ) < gaussAbscissa ∧ gaussAbscissa < 2 / 3 := by
21
+ have hp := gaussAbscissa_pos
22
+ have hs := gaussAbscissa_sq
23
+ constructor <;> nlinarith
24
+
25
+ theorem gaussNode_bounds (b : Fin 2) :
26
+ -gaussAbscissa ≤ gaussNode b ∧ gaussNode b ≤ gaussAbscissa := by
27
+ fin_cases b <;> norm_num [gaussNode, gaussAbscissa_pos.le]
28
+
29
+ theorem gauss_lattice_coordinate_separation {h : ℝ} (hh : 0 < h)
30
+ (k l : ℤ) (b c : Fin 2) (hne : k ≠ l ∨ b ≠ c) :
31
+ h / 3 ≤ |h * ((k : ℝ) + gaussNode b / 2) -
32
+ h * ((l : ℝ) + gaussNode c / 2)| := by
33
+ have hb := gaussNode_bounds b
34
+ have hc := gaussNode_bounds c
35
+ have ha := gaussAbscissa_bounds
36
+ rcases lt_trichotomy k l with hkl | hkl | hkl
37
+ · have hi : (k : ℝ) + 1 ≤ l := by exact_mod_cast (show k + 1 ≤ l by omega)
38
+ have hprod := mul_nonneg hh.le (show 0 ≤ gaussNode c - gaussNode b + 2 * gaussAbscissa by linarith)
39
+ have hscale := mul_pos hh (show 0 < (2 / 3 : ℝ) - gaussAbscissa by linarith)
40
+ have hInt := mul_nonneg hh.le (show 0 ≤ (l : ℝ) - k - 1 by linarith)
41
+ nlinarith [neg_le_abs (h * ((k : ℝ) + gaussNode b / 2) -
42
+ h * ((l : ℝ) + gaussNode c / 2))]
43
+ · subst l
44
+ have hbc : b ≠ c := hne.resolve_left (not_not.mpr rfl)
45
+ have hplus := le_abs_self (h * ((k : ℝ) + gaussNode b / 2) -
46
+ h * ((k : ℝ) + gaussNode c / 2))
47
+ have hminus := neg_le_abs (h * ((k : ℝ) + gaussNode b / 2) -
48
+ h * ((k : ℝ) + gaussNode c / 2))
49
+ have hscale := mul_pos hh (show 0 < gaussAbscissa - (1 / 3 : ℝ) by linarith)
50
+ fin_cases b <;> fin_cases c <;> norm_num [gaussNode] at * <;> nlinarith
51
+ · have hi : (l : ℝ) + 1 ≤ k := by exact_mod_cast (show l + 1 ≤ k by omega)
52
+ have hprod := mul_nonneg hh.le (show 0 ≤ gaussNode b - gaussNode c + 2 * gaussAbscissa by linarith)
53
+ have hscale := mul_pos hh (show 0 < (2 / 3 : ℝ) - gaussAbscissa by linarith)
54
+ have hInt := mul_nonneg hh.le (show 0 ≤ (k : ℝ) - l - 1 by linarith)
55
+ nlinarith [le_abs_self (h * ((k : ℝ) + gaussNode b / 2) -
56
+ h * ((l : ℝ) + gaussNode c / 2))]
57
+
58
+ theorem gaussLatticePoint_separation {h : ℝ} (hh : 0 < h)
59
+ (i j : GaussLatticeIndex) (hne : i ≠ j) :
60
+ h / 3 ≤ ‖gaussLatticePoint h i - gaussLatticePoint h j‖ := by
61
+ have hex : ∃ a, i.1 a ≠ j.1 a ∨ i.2 a ≠ j.2 a := by
62
+ by_contra hn
63
+ push Not at hn
64
+ exact hne (Prod.ext (funext (fun a => (hn a).1)) (funext (fun a => (hn a).2)))
65
+ obtain ⟨a, ha⟩ := hex
66
+ have hcoord := gauss_lattice_coordinate_separation hh (i.1 a) (j.1 a) (i.2 a) (j.2 a) ha
67
+ have hb := PiLp.norm_apply_le (gaussLatticePoint h i - gaussLatticePoint h j) a
68
+ change |h * ((i.1 a : ℝ) + gaussNode (i.2 a) / 2) -
69
+ h * ((j.1 a : ℝ) + gaussNode (j.2 a) / 2)| ≤ _ at hb
70
+ exact hcoord.trans hb
71
+
72
+ /-- The inverse Lipschitz estimate gives a quantitative separation suitable
73
+ for rational nuclear placement, for any finite selection of cells. -/
74
+ theorem transportedGauss_rounding_injective {m denominator : ℕ}
75
+ (hdenom : 0 < denominator) {h : ℝ} (hh : 0 < h)
76
+ (index : Fin m → GaussLatticeIndex) (hindex : Function.Injective index)
77
+ (G : Position → Position) {C : ℝ≥0} (hC : 0 < C)
78
+ (hG : AntilipschitzWith C G)
79
+ (hprecision : 6 / (denominator : ℝ) < h / (3 * (C : ℝ))) :
80
+ Function.Injective (fun i => roundPosition denominator (G (gaussLatticePoint h (index i)))) := by
81
+ apply roundPosition_injective hdenom
82
+ intro i j hij
83
+ have hbase := gaussLatticePoint_separation hh (index i) (index j) (fun h => hij (hindex h))
84
+ have htrans := hG.le_mul_dist (gaussLatticePoint h (index i)) (gaussLatticePoint h (index j))
85
+ simp only [dist_eq_norm] at htrans
86
+ have hdiv : h / (3 * (C : ℝ)) ≤
87
+ ‖G (gaussLatticePoint h (index i)) - G (gaussLatticePoint h (index j))‖ := by
88
+ apply (div_le_iff₀ (show 0 < 3 * (C : ℝ) by positivity)).mpr
89
+ nlinarith
90
+ exact hprecision.trans_le hdiv
91
+
92
+ end ContinuumCoulomb
93
+
94
+ end
95
+
96
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle.lean ADDED
@@ -0,0 +1,432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.AbsoluteNuclearForm
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.AffinePhysicalOutput
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.AffinePhysicalThreshold
4
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ApproximateBisection
5
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.AtomicOutputs
6
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.BoundedFormCross
7
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.BoundedPotentialOperator
8
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisection
9
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisectionLocation
10
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisectionMachine
11
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisectionSchedule
12
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedContactCorrectness
13
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationBudget
14
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationComponents
15
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationError
16
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationParameters
17
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedGraphError
18
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedHoppingBound
19
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedLipschitzBound
20
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedMatrixError
21
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationCoefficientError
22
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationCoulombBrackets
23
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationEndpointSigns
24
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationGraphBudget
25
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationMesh
26
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationRationalBracket
27
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationSquareError
28
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedCoulombKernel
29
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedCoulombMass
30
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedCoulombTruncation
31
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedRawModulus
32
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedWells
33
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CenteredGaussEquiv
34
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CenteredGaussLabels
35
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CenteredGrid
36
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CenteredPhysicalThreshold
37
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ClassicalH1
38
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ClassicalResidualPairing
39
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ClassicalSlater
40
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ClassicalSlaterKinetic
41
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ClassicalSlaterSynthesis
42
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ClassicalTensor
43
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactCoulombJets
44
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactCoulombSmooth
45
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactNuclearPairing
46
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactOrbitalDensity
47
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactOrbitalNuclearError
48
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactOrbitalQuadrature
49
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactSobolevCore
50
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactSourceGrid
51
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactSourcePairing
52
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CompactSourceTransport
53
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ComplexFormSplit
54
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ComplexMollification
55
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactAdjustment
56
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactBaseSeparation
57
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactCalibratedGeometry
58
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactCalibration
59
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactCalibrationScale
60
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactCanonicalEdge
61
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactClosedCoordinates
62
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactDisplacement
63
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactEdgeNumber
64
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactExtent
65
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactGadgetStability
66
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactGadgets
67
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactGeometryBlockSemantics
68
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactGlobal
69
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactGlobalSeparation
70
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactGrid
71
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactHeightBisection
72
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactHeightBounds
73
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactHeightEvaluation
74
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactLattice
75
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactMediator
76
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactMediatorGeometry
77
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactMediatorLinks
78
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactPathBounds
79
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactPolynomialGeometry
80
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactPositionArray
81
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactQuotientBounds
82
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactRationalCoordinates
83
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactRationalGadget
84
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactRationalGlobal
85
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactRationalLocal
86
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactRealization
87
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactSourceGrid
88
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactSourceInputCorrectness
89
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactStrips
90
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactTemplates
91
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoordinateLaplacian
92
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoreOrbitalCongruence
93
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoreOrbitalProjection
94
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoreTensorFiber
95
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedComplement
96
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedCrossBound
97
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedCrossForm
98
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedDiagonalBound
99
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedManufacturedResidual
100
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedNuclearError
101
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedOneElectronProjection
102
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedRemainderGap
103
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedResidualPairing
104
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CorrectedStateCoordinates
105
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombCalibration
106
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombCubeCoordinates
107
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombCubeModulus
108
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombEvaluationError
109
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombEvaluationParameters
110
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombFarCell
111
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombGram
112
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombGramApprox
113
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombInverseFifth
114
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombKernelHomogeneity
115
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombKernelSmooth
116
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombNormalizationError
117
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombPacketCoercivity
118
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombPacketTests
119
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombPackets
120
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombPairEvaluation
121
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombPairSum
122
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombPoisson
123
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombQuadrature
124
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombQuadratureBudget
125
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombRawEvaluation
126
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombSourceCubature
127
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombTargetLipschitz
128
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombTargetRange
129
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombTruncationSchedule
130
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CountertermEvaluation
131
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CubeGeometry
132
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CubeIntegral
133
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CubeMeasure
134
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.DiagonalPenalty
135
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.DirectionalFourthDerivative
136
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ExceptionalCellVolume
137
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ExplicitVerticalCutoff
138
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.FullSpinTensorCoefficients
139
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.FullTensorComplement
140
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianFrequency
141
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianJetBounds
142
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianLine
143
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianMollification
144
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianPacket
145
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianPoincare
146
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GaussianScalar
147
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GraphCoefficientStability
148
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GridGroundUpper
149
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GridNodePrecision
150
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GridNuclei
151
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GroundRoundingInterval
152
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.H1BoundedForm
153
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.H1FiniteProjection
154
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.H1GraphCore
155
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.H1PairingBound
156
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HeatDensityModulus
157
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HeatKernelModulus
158
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HeatSampleError
159
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HoppingBox
160
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HoppingQuadrature
161
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HoppingSchedule
162
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HydrogenInput
163
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.InverseFifthCutoffGrid
164
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.InverseFifthGrid
165
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.IsolatedForms
166
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.IsolatedPerturbation
167
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.IsolatedSpectrum
168
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCorrectedMatrixError
169
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCorrectedOneBody
170
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulomb
171
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombBox
172
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombGap
173
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombLipschitz
174
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombMatrix
175
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombNumerics
176
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombRadial
177
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombSymmetry
178
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulombTranslation
179
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCountertermMatrix
180
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCounterterms
181
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedDensityMoment
182
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedDualMatrix
183
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedDuality
184
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedFockStates
185
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedFourIndex
186
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedGradientMoments
187
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedGram
188
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedGramConstants
189
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedGramSpacing
190
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedGroundUpper
191
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedHigherMoments
192
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedHubbard
193
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedHubbardEntries
194
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedHubbardForm
195
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedHubbardTensor
196
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedLeakage
197
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedLinearCoulomb
198
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedLinearOrbitals
199
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedMatrixDecayBound
200
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedModeDerivatives
201
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedModes
202
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedMomentTail
203
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedMultiwellResidual
204
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedNuclearHardy
205
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedOneBody
206
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedOneBodyMatrix
207
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedOrbitalGram
208
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedOverlapSpacing
209
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedRawDensity
210
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedSpinOperator
211
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedTensorResidual
212
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedTransition
213
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedWellMatrix
214
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedWellResidual
215
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedCoercivity
216
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedCompactQuadrature
217
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedComplement
218
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedComplementBudget
219
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedEuler
220
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedFarGrid
221
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedFieldBounds
222
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedFieldEvaluation
223
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedFrequency
224
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedGapScale
225
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedGridError
226
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedGridGroundComparison
227
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedGridParameters
228
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedGridWitness
229
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedGrowingGap
230
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedHubbardComparison
231
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedManyElectron
232
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedNuclearComparison
233
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedNuclearForm
234
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedNuclearTensorLower
235
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedOneElectronGap
236
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedOrbitalNuclearError
237
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedOrbitalResidual
238
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedPolynomialComparison
239
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedPreciseResidual
240
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedProjectedLower
241
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedResidualGap
242
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedResidualMajorant
243
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedResidualPairing
244
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedResidualParameters
245
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedResidualScale
246
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedScalarParameters
247
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedScaleThreshold
248
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedSlabLower
249
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedTensorCoercivity
250
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedTensorDiagonal
251
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedTensorGap
252
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedTensorLower
253
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedTensorProjection
254
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedTransport
255
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedUniformComparison
256
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedUniformFlow
257
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedUniformGap
258
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedVelocityEvaluation
259
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedWeakResidual
260
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ManufacturedWellField
261
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.MixedSlater
262
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.MovingWells
263
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.NormalizationArithmetic
264
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.NormalizationQuadrature
265
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.NormalizationSchedule
266
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.NumericalGridRounding
267
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.NumericalSquare
268
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneBodyScaleBudget
269
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneElectronClosure
270
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneElectronComplexLaplacian
271
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneElectronCoordinates
272
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneElectronFormDecomposition
273
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneElectronProjectedLower
274
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OneElectronTrial
275
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalBasisExtension
276
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalCellVolume
277
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalComplementCount
278
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalCutoff
279
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalCutoffTail
280
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalDerivative
281
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalGraphBounds
282
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalJetBounds
283
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalNuclearTail
284
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.OrbitalTensor
285
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarCalibration
286
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarCompactnessEstimates
287
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarCutoffTail
288
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarDistributionAxes
289
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarExponentialEnvelope
290
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarFieldBounds
291
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarForcing
292
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarForcingModulus
293
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarFrameBound
294
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarGapFromUniqueness
295
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarGradientMoments
296
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarGroundDuality
297
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarGroundIdentity
298
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarGroundTransform
299
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarGroundUniqueness
300
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatBoxBounds
301
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatBoxCoordinates
302
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatDifferential
303
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatEvolution
304
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatKernel
305
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatLimit
306
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatTimeModulus
307
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHeatTruncation
308
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHopping
309
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarHoppingBounds
310
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarIMS
311
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarIMSBounds
312
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarLaplaceIBP
313
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarLocalization
314
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarLowerTail
315
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarModeDecay
316
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarModeDerivatives
317
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarModeEnergy
318
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarModeH1
319
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarModeJets
320
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarModeProperties
321
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarMultiwellGap
322
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarMultiwellMatrix
323
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarMultiwellProjection
324
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarMultiwellScale
325
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarNearGroundCompactness
326
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarNormalizationBox
327
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarNormalizationTail
328
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarNormalized
329
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarOverlap
330
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarPartition
331
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarPolynomialScale
332
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarProjectionGap
333
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarRadial
334
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarResolvent
335
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarResolventEquation
336
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarResolventModulus
337
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarResolventTails
338
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarScaleChoice
339
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarSharpDecay
340
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarSiteCutoffs
341
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarSliceProjection
342
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarSobolev
343
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarSobolevDuality
344
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarSpectralInput
345
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarTestCauchy
346
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarTranslatedGap
347
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarUniformCalibration
348
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarWeakConstant
349
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarWellBottom
350
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarWellLocalization
351
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarWellMatrix
352
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarWellNumerics
353
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarWellOverlap
354
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PrefactorCalibration
355
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PrefactorSourceCalibration
356
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PrefactorSourceContactCorrectness
357
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PrefactorSpacing
358
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalBoxRound
359
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalClamp
360
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalContactBudget
361
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalContactMatrix
362
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalExponential
363
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalFieldDifferences
364
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalGaussNodes
365
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalHeatBox
366
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalHeatPlaneError
367
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalHeatSample
368
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalLogScale
369
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalResolventError
370
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalSixQuadrature
371
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalSmoothTransition
372
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalSquareRoot
373
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalTaylorRegisters
374
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalTripleQuadrature
375
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RayleighGround
376
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RealMollification
377
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RealOneElectronState
378
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RealOrbitalResidual
379
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RealSpinOrbitals
380
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RectangleQuadrature
381
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ResolventNumericalBounds
382
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ResolventSchedule
383
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ScalarMollification
384
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ScalarScaleBudgets
385
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ScaledNuclearNear
386
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SeparatedNuclearNear
387
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SharpBlockPerturbation
388
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ShiftedHubbardBounds
389
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ShiftedPhysicalForm
390
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SingleSpinSource
391
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SlowLogarithmicExtent
392
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SmoothCutoffApproximation
393
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SobolevDensity
394
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SobolevDensityInput
395
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitCoordinates
396
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitFormIdentity
397
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitFormIntegrals
398
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitFrameBound
399
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitIntegratedBounds
400
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitProjectionBudget
401
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitProjectionPairing
402
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitPullback
403
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitSpectralBudget
404
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.SplitTestFunctions
405
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.TM2Composition
406
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ThirdOrderBottom
407
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ThirdOrderPerturbation
408
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ThirdOrderScale
409
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.TransformedGauss
410
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.TransformedGaussList
411
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.TransformedGaussSeparation
412
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.TruncatedNuclearForm
413
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.UnitBinaryInclusion
414
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.UnitProgramGroundInterval
415
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalCappedForm
416
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalCappedGap
417
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalCappedScale
418
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalCutoffTail
419
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalEnergy
420
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalFactorization
421
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalMode
422
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalOscillatorGap
423
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalResidual
424
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalSliceProjection
425
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.VerticalSpectralInput
426
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WeakComplexLaplacian
427
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WeakH1Laplacian
428
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WeakH1Pairing
429
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WellCapDerivatives
430
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WellCapRegularity
431
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WellCover
432
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WellFieldOrbitalResidual
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AbsoluteNuclearForm.lean ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearGridPotential
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.ManyBody.WeightedPotentialBound
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.SlabRegularity
4
+
5
+ namespace OAI
6
+
7
+ /-! Absolute-value form bound for unit-nucleus replacement. It holds
8
+ for every spin component of every many-electron weak-H1 state. -/
9
+
10
+ noncomputable section
11
+ open MeasureTheory
12
+ open scoped BigOperators NNReal
13
+ namespace ContinuumCoulomb
14
+
15
+ theorem manufactured_grid_absolute_form_error (hpublished : PublishedC4FlowInput)
16
+ (L K : ℝ≥0) (hL : 0 < L) (hK : 0 < K) :
17
+ ∃ C A : ℝ, 1 ≤ C ∧ 1 ≤ A ∧
18
+ ∀ (rho H S freq scale : ℝ) (m : ℕ) (u : Fin m → PlanarPosition),
19
+ 0 < rho → 0 ≤ H → 1 ≤ S →
20
+ (∀ x, |manufacturedCharge (manufacturedWellField freq scale S u) x| ≤ rho/2) →
21
+ tsupport (manufacturedWellField freq scale S u) ⊆ slabDomain H S →
22
+ ∀ (G : Position → ℝ → Position),
23
+ IsUnitTimeFlow (moserVelocity rho (manufacturedWellField freq scale S u)) G →
24
+ Function.Bijective (fun x => G x 1) →
25
+ (∀ x, x ∉ tsupport (manufacturedWellField freq scale S u) → G x 1 = x) →
26
+ ∀ (D : ℝ), 1 ≤ D →
27
+ (∀ x, ∀ k : ℕ, 1 ≤ k → k ≤ 4 → ‖iteratedFDeriv ℝ k (fun x => G x 1) x‖ ≤ D^k) →
28
+ LipschitzWith L (fun x => G x 1) → AntilipschitzWith K (fun x => G x 1) →
29
+ ∀ {ι : Type} [Fintype ι] (index : ι → Fin 3 → ℤ), Function.Injective index →
30
+ ∀ (h : ℝ), 0 < h → h ≤ 1 →
31
+ (⋃ i, positionCube (gaussCellCenter h (index i)) h) = slabDomain H S →
32
+ ∀ (n : ℕ) (w : Coulomb.H1Vector n) (s : SpinConfiguration n) (i : Fin n),
33
+ Integrable (fun x => |gridNuclearPotential index (fun x => G x 1) rho h (Coulomb.position x i)-
34
+ (slabPotential rho H S (Coulomb.position x i)+
35
+ manufacturedWellField freq scale S u (Coulomb.position x i))| * ‖w.value s x‖^2) ∧
36
+ (∫ x, |gridNuclearPotential index (fun x => G x 1) rho h (Coulomb.position x i)-
37
+ (slabPotential rho H S (Coulomb.position x i)+
38
+ manufacturedWellField freq scale S u (Coulomb.position x i))| *‖w.value s x‖^2) ≤
39
+ rho*(24*C*D^4*(3072*Real.pi*h^2/(L:ℝ)^2+216*m*S*h^4)+108*Real.pi*(L:ℝ)^2*h^2)*
40
+ (∫ x, ‖w.value s x‖^2)+
41
+ rho*A*h^2*((∫ x, ‖w.value s x‖^2)+∑ k : Fin 3, ∫ x, ‖w.gradient s (i,k) x‖^2) := by
42
+ obtain ⟨C,hC,hpoint⟩ := manufactured_grid_potential_error hpublished
43
+ have hκ : 0 < 6*(L:ℝ) := by positivity
44
+ obtain ⟨A,hA,hnear⟩ := transportedGauss_truncated_form hκ K hK
45
+ refine ⟨C,A,hC,hA,?_⟩
46
+ intro rho H S freq scale m u hrho hH hS hcharge hsupp G hflow hbij hfix D hD hGD hLip hAnti
47
+ ι _ index hindex h hh hh1 hcover n w s i
48
+ let F : Position → ℝ := fun y => gridNuclearPotential index (fun x => G x 1) rho h y-
49
+ (slabPotential rho H S y+manufacturedWellField freq scale S u y)
50
+ let B := rho*(24*C*D^4*(3072*Real.pi*h^2/(L:ℝ)^2+216*m*S*h^4)+108*Real.pi*(L:ℝ)^2*h^2)
51
+ let R : ι × (Fin 3 → Fin 2) → Position := fun a => G (gaussLatticePoint h (gridGaussIndex index a)) 1
52
+ have hF : Measurable F := (gridNuclearPotential_measurable index (fun x => G x 1) rho h).sub
53
+ (((slabPotential_continuous hrho.le hH (by linarith)).add
54
+ (manufacturedWellField_C7 freq scale S u).continuous).measurable)
55
+ have he := weighted_potential_absolute_bound w s i F hF R (6*(L:ℝ)*h) B (rho*h^3/8)
56
+ (hpoint rho H S freq scale m u hrho hH hS hcharge hsupp G hflow hbij hfix
57
+ D hD hGD L hL hLip index hindex h hh hh1 hcover)
58
+ have hn := hnear n w s i h rho hh hh1 hrho.le (gridGaussIndex index)
59
+ (gridGaussIndex_injective index hindex) (fun x => G x 1) hAnti
60
+ exact ⟨he.1, he.2.trans (add_le_add le_rfl hn)⟩
61
+
62
+ end ContinuumCoulomb
63
+
64
+ end
65
+
66
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AffinePhysicalOutput.lean ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.AffinePhysicalThresholdProgram
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.UnitCoulombProgram
3
+
4
+ namespace OAI
5
+
6
+ /-! A canonical unit-charge instance with the complete physical scalar offset.
7
+ The coordinate and threshold metadata remain explicit until the source program
8
+ supplies the same fixed polynomial scales to both components. -/
9
+
10
+ namespace ContinuumCoulomb.AffinePhysicalOutput
11
+ open ExactQuantumFactoring.BitStackProgram
12
+
13
+ abbrev Input := PhysicalNuclearProgram.Input × AffinePhysicalThreshold.Input
14
+
15
+ def inputCode : Input → List Bool :=
16
+ prodCode PhysicalNuclearProgram.inputCode AffinePhysicalThreshold.inputCode
17
+
18
+ noncomputable def argument (rho : ℕ) (x : Input) : UnitCoulombProgram.Input :=
19
+ (x.1,(x.2.1.2.1,AffinePhysicalThreshold.value rho x.2))
20
+
21
+ noncomputable def value (rho U C K : ℕ) (x : Input) : UnitCoulomb :=
22
+ UnitCoulombProgram.value rho U C K (argument rho x)
23
+
24
+ noncomputable opaque argumentProgram (rho : ℕ) :
25
+ Procedure inputCode UnitCoulombProgram.inputCode (argument rho) := by
26
+ let geom := Procedure.first PhysicalNuclearProgram.inputCode AffinePhysicalThreshold.inputCode
27
+ let numbers := Procedure.second PhysicalNuclearProgram.inputCode AffinePhysicalThreshold.inputCode
28
+ let count := AffinePhysicalThreshold.electronsProgram.comp numbers
29
+ let endpoints := (AffinePhysicalThreshold.program rho).comp numbers
30
+ exact geom.pair (count.pair endpoints)
31
+
32
+ noncomputable opaque program (rho U C K : ℕ) :
33
+ Procedure inputCode unitCoulombCodec.encode (value rho U C K) :=
34
+ (UnitCoulombProgram.program rho U C K).comp (argumentProgram rho)
35
+
36
+ noncomputable def certificate (rho U C K : ℕ) :
37
+ Turing.TM2ComputableInPolyTime inputCode unitCoulombCodec.encode (value rho U C K) :=
38
+ (program rho U C K).toTM2
39
+
40
+ theorem nuclei (rho U C K : ℕ) (x : Input) :
41
+ (value rho U C K x).nuclei = PhysicalNuclearProgram.nuclei rho U C K x.1 := rfl
42
+
43
+ theorem electrons (rho U C K : ℕ) (x : Input) :
44
+ (value rho U C K x).electrons = x.2.1.2.1 := rfl
45
+
46
+ theorem lower (rho U C K : ℕ) (x : Input) :
47
+ (value rho U C K x).lower.value = (AffinePhysicalThreshold.value rho x.2).1 :=
48
+ NuclearCoordinateOutput.rational_value _
49
+
50
+ theorem upper (rho U C K : ℕ) (x : Input) :
51
+ (value rho U C K x).upper.value = (AffinePhysicalThreshold.value rho x.2).2 :=
52
+ NuclearCoordinateOutput.rational_value _
53
+
54
+ theorem actual_error (rho U C K : ℕ) (hrho : 0 < rho) (x : Input)
55
+ (hmesh : 0 < x.2.1.1.1) {m : ℕ}
56
+ (u : Fin m → CoulombPairSum.Point) (hu : Function.Injective u)
57
+ (hsites : x.2.2.2.1 = List.ofFn u) :
58
+ let v := CoulombPairSum.exactTotal (GaussianFrequency.frequency rho) u
59
+ |((value rho U C K x).lower.value:ℝ)-
60
+ (AffinePhysicalThreshold.exactValue rho x.2 v).1| ≤ 1/(x.2.1.2.2.1+1:ℝ) ∧
61
+ |((value rho U C K x).upper.value:ℝ)-
62
+ (AffinePhysicalThreshold.exactValue rho x.2 v).2| ≤ 1/(x.2.1.2.2.1+1:ℝ) := by
63
+ dsimp only
64
+ rw [lower,upper]
65
+ exact AffinePhysicalThreshold.actual_error rho hrho x.2 hmesh u hu hsites
66
+
67
+ theorem valid (rho U C K : ℕ) (x : Input) (hne : 0 < x.2.1.2.1)
68
+ (hpositions : ((PhysicalNuclearProgram.nuclei rho U C K x.1).map BinaryPosition.value).Nodup)
69
+ (hgap : (1:ℚ) ≤ CenteredPhysicalThreshold.amplification rho x.2.1.1.1*x.2.2.1^2*
70
+ (x.2.1.2.2.2.2-x.2.1.2.2.2.1)) : (value rho U C K x).Valid := by
71
+ apply UnitCoulombProgram.valid rho U C K (x.1,(x.2.1.2.1,AffinePhysicalThreshold.value rho x.2))
72
+ hne hpositions
73
+ rw [AffinePhysicalThreshold.gap]
74
+ exact hgap
75
+
76
+ end ContinuumCoulomb.AffinePhysicalOutput
77
+
78
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AffinePhysicalThreshold.lean ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.CenteredPhysicalThresholdProgram
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.CoulombPairSumProgram
3
+
4
+ namespace OAI
5
+
6
+ /-! The complete scalar shift in the unit-charge construction. Input endpoints
7
+ already contain the exact mediator offset. The remaining finite shift is the
8
+ sum of edge weights and the off-site Coulomb energy; only the latter and the
9
+ one-particle reference require numerical approximation. -/
10
+
11
+ noncomputable section
12
+ namespace ContinuumCoulomb.AffinePhysicalThreshold
13
+
14
+ abbrev Input := CenteredPhysicalThreshold.Input × (ℚ × (List CoulombPairSum.Point × List ℚ))
15
+
16
+ def pairPrecision (x : Input) : ℕ :=
17
+ (8*x.1.1.1^3+1)*(2*(x.1.2.2.1+1))
18
+
19
+ def pairValue (rho : ℕ) (x : Input) : ℚ :=
20
+ CoulombPairSum.value rho (pairPrecision x,x.2.2.1)
21
+
22
+ def finiteValue (rho : ℕ) (x : Input) : ℚ×ℚ :=
23
+ (x.2.1^2*(x.1.2.2.2.1-x.2.2.2.sum)-pairValue rho x,
24
+ x.2.1^2*(x.1.2.2.2.2-x.2.2.2.sum)-pairValue rho x)
25
+
26
+ def argument (rho : ℕ) (x : Input) : CenteredPhysicalThreshold.Input :=
27
+ (x.1.1,(x.1.2.1,(2*(x.1.2.2.1+1),finiteValue rho x)))
28
+
29
+ def value (rho : ℕ) (x : Input) : ℚ×ℚ :=
30
+ CenteredPhysicalThreshold.value rho (argument rho x)
31
+
32
+ def exactFinite (x : Input) (v : ℝ) : ℝ×ℝ :=
33
+ ((x.2.1:ℝ)^2*((x.1.2.2.2.1:ℝ)-(x.2.2.2.sum:ℝ))-v,
34
+ (x.2.1:ℝ)^2*((x.1.2.2.2.2:ℝ)-(x.2.2.2.sum:ℝ))-v)
35
+
36
+ def exactValue (rho : ℕ) (x : Input) (v : ℝ) : ℝ×ℝ :=
37
+ (CenteredPhysicalThreshold.actualOffset rho x.1+
38
+ (CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)*(exactFinite x v).1,
39
+ CenteredPhysicalThreshold.actualOffset rho x.1+
40
+ (CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)*(exactFinite x v).2)
41
+
42
+ theorem pair_budget (rho : ℕ) (hrho : 0 < rho) (x : Input) :
43
+ (CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)/(pairPrecision x+1:ℝ) ≤
44
+ 1/(2*((x.1.2.2.1:ℝ)+1)) := by
45
+ have ha := CenteredPhysicalThreshold.amplification_bound rho x.1.1.1 hrho
46
+ have hp : 0 < 2*((x.1.2.2.1:ℝ)+1) := by positivity
47
+ have hd : 0 < (pairPrecision x:ℝ)+1 := by positivity
48
+ apply (div_le_div_iff₀ hd hp).mpr
49
+ have hm := mul_le_mul_of_nonneg_right ha.2 hp.le
50
+ simp only [pairPrecision,Nat.cast_mul,Nat.cast_add,Nat.cast_one,Nat.cast_pow,
51
+ Nat.cast_ofNat]
52
+ nlinarith
53
+
54
+ theorem reference_budget (x : Input) :
55
+ 1/((2*(x.1.2.2.1+1):ℕ)+1:ℝ) ≤ 1/(2*((x.1.2.2.1:ℝ)+1)) := by
56
+ apply one_div_le_one_div_of_le (by positivity)
57
+ simp only [Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat,Nat.cast_one]
58
+ linarith
59
+
60
+ theorem value_error (rho : ℕ) (hrho : 0 < rho) (x : Input)
61
+ (hmesh : 0 < x.1.1.1) (v : ℝ)
62
+ (hv : |(pairValue rho x:ℝ)-v| ≤ 1/(pairPrecision x+1:ℝ)) :
63
+ |((value rho x).1:ℝ)-(exactValue rho x v).1| ≤ 1/(x.1.2.2.1+1:ℝ) ∧
64
+ |((value rho x).2:ℝ)-(exactValue rho x v).2| ≤ 1/(x.1.2.2.1+1:ℝ) := by
65
+ have ha := CenteredPhysicalThreshold.amplification_bound rho x.1.1.1 hrho
66
+ have hp : 0 < (x.1.2.2.1:ℝ)+1 := by positivity
67
+ have hoff := (CenteredPhysicalThreshold.offset_error rho hrho (argument rho x) hmesh).trans
68
+ (reference_budget x)
69
+ have hpair : (CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)*
70
+ |(pairValue rho x:ℝ)-v| ≤ 1/(2*((x.1.2.2.1:ℝ)+1)) := by
71
+ apply (mul_le_mul_of_nonneg_left hv ha.1).trans
72
+ simpa only [mul_one_div] using pair_budget rho hrho x
73
+ have hsum : 1/(2*((x.1.2.2.1:ℝ)+1))+1/(2*((x.1.2.2.1:ℝ)+1)) =
74
+ 1/((x.1.2.2.1:ℝ)+1) := by
75
+ field_simp [hp.ne']
76
+ ring
77
+ have hid1 : ((value rho x).1:ℝ)-(exactValue rho x v).1 =
78
+ ((CenteredPhysicalThreshold.offset rho (argument rho x):ℝ)-CenteredPhysicalThreshold.actualOffset rho x.1)-
79
+ (CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)*((pairValue rho x:ℝ)-v) := by
80
+ simp only [value,CenteredPhysicalThreshold.value,exactValue,exactFinite,argument,finiteValue,
81
+ Rat.cast_add,Rat.cast_sub,Rat.cast_mul,Rat.cast_pow]
82
+ ring
83
+ have hid2 : ((value rho x).2:ℝ)-(exactValue rho x v).2 =
84
+ ((CenteredPhysicalThreshold.offset rho (argument rho x):ℝ)-CenteredPhysicalThreshold.actualOffset rho x.1)-
85
+ (CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)*((pairValue rho x:ℝ)-v) := by
86
+ simp only [value,CenteredPhysicalThreshold.value,exactValue,exactFinite,argument,finiteValue,
87
+ Rat.cast_add,Rat.cast_sub,Rat.cast_mul,Rat.cast_pow]
88
+ ring
89
+ have hoff' : |(CenteredPhysicalThreshold.offset rho (argument rho x):ℝ)-
90
+ CenteredPhysicalThreshold.actualOffset rho x.1| ≤ 1/(2*((x.1.2.2.1:ℝ)+1)) := hoff
91
+ have htri := abs_sub_le ((CenteredPhysicalThreshold.offset rho (argument rho x):ℝ)-
92
+ CenteredPhysicalThreshold.actualOffset rho x.1) 0
93
+ ((CenteredPhysicalThreshold.amplification rho x.1.1.1:ℝ)*((pairValue rho x:ℝ)-v))
94
+ simp only [sub_zero,zero_sub,abs_neg] at htri
95
+ have hbound := htri.trans
96
+ (add_le_add hoff' (by simpa only [abs_mul,abs_of_nonneg ha.1] using hpair))
97
+ rw [hsum] at hbound
98
+ constructor
99
+ · rw [hid1]
100
+ exact hbound
101
+ · rw [hid2]
102
+ exact hbound
103
+
104
+ theorem actual_error (rho : ℕ) (hrho : 0 < rho) (x : Input)
105
+ (hmesh : 0 < x.1.1.1) {m : ℕ}
106
+ (u : Fin m → CoulombPairSum.Point) (hu : Function.Injective u)
107
+ (hsites : x.2.2.1 = List.ofFn u) :
108
+ let v := CoulombPairSum.exactTotal (GaussianFrequency.frequency rho) u
109
+ |((value rho x).1:ℝ)-(exactValue rho x v).1| ≤ 1/(x.1.2.2.1+1:ℝ) ∧
110
+ |((value rho x).2:ℝ)-(exactValue rho x v).2| ≤ 1/(x.1.2.2.1+1:ℝ) := by
111
+ apply value_error rho hrho x hmesh
112
+ simpa only [pairValue,hsites] using
113
+ CoulombPairSum.error rho (pairPrecision x) hrho u hu
114
+
115
+ theorem gap (rho : ℕ) (x : Input) :
116
+ (value rho x).2-(value rho x).1 =
117
+ CenteredPhysicalThreshold.amplification rho x.1.1.1*x.2.1^2*
118
+ (x.1.2.2.2.2-x.1.2.2.2.1) := by
119
+ rw [value,CenteredPhysicalThreshold.gap]
120
+ simp only [argument,finiteValue]
121
+ ring
122
+
123
+ end ContinuumCoulomb.AffinePhysicalThreshold
124
+
125
+ end
126
+
127
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/ApproximateBisection.lean ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib.Analysis.SpecialFunctions.Pow.Real
2
+ import Mathlib.Data.Rat.Cast.Order
3
+ import Mathlib.Tactic
4
+
5
+ namespace OAI
6
+
7
+ /-! Approximate rational bisection for a Lipschitz residual. A numerically
8
+ ambiguous sign terminates with a certified residual bound; otherwise the
9
+ true endpoint signs are preserved. No monotonicity or derivative lower
10
+ bound is required. -/
11
+
12
+ namespace ContinuumCoulomb.ApproximateBisection
13
+
14
+ structure Interval where
15
+ lo : ℚ
16
+ hi : ℚ
17
+ settled : Bool
18
+ deriving DecidableEq
19
+
20
+ def midpoint (s : Interval) : ℚ := (s.lo + s.hi) / 2
21
+
22
+ def width (s : Interval) : ℝ := (s.hi : ℝ) - s.lo
23
+
24
+ def step (δ : ℚ) (evaluate : ℚ → ℚ) (s : Interval) : Interval :=
25
+ if s.settled then s
26
+ else if δ < evaluate (midpoint s) then ⟨midpoint s, s.hi, false⟩
27
+ else if evaluate (midpoint s) < -δ then ⟨s.lo, midpoint s, false⟩
28
+ else ⟨midpoint s, midpoint s, true⟩
29
+
30
+ def initial (a b : ℚ) : Interval := ⟨a, b, false⟩
31
+
32
+ def run (δ : ℚ) (evaluate : ℚ → ℚ) (a b : ℚ) (n : ℕ) : Interval :=
33
+ (step δ evaluate)^[n] (initial a b)
34
+
35
+ @[simp] theorem midpoint_cast (s : Interval) :
36
+ (midpoint s : ℝ) = ((s.lo : ℝ) + s.hi) / 2 := by
37
+ simp [midpoint]
38
+
39
+ theorem midpoint_mem (s : Interval) (h : s.lo ≤ s.hi) :
40
+ s.lo ≤ midpoint s ∧ midpoint s ≤ s.hi := by
41
+ dsimp [midpoint]
42
+ constructor <;> linarith
43
+
44
+ /-- The invariant concerns actual residual values, not numerical signs. -/
45
+ structure Invariant (a b : ℚ) (f : ℝ → ℝ) (δ : ℚ) (s : Interval) : Prop where
46
+ lower : a ≤ s.lo
47
+ upper : s.hi ≤ b
48
+ ordered : s.lo ≤ s.hi
49
+ certified : s.settled = true → s.lo = s.hi ∧ |f s.lo| ≤ 2 * (δ : ℝ)
50
+ signs : s.settled = false → 0 ≤ f s.lo ∧ f s.hi ≤ 0
51
+
52
+ theorem initial_invariant {a b δ : ℚ} {f : ℝ → ℝ}
53
+ (hab : a ≤ b) (ha : 0 ≤ f a) (hb : f b ≤ 0) :
54
+ Invariant a b f δ (initial a b) := by
55
+ refine ⟨le_rfl, le_rfl, hab, ?_, ?_⟩
56
+ · simp [initial]
57
+ · intro _
58
+ exact ⟨ha, hb⟩
59
+
60
+ theorem step_invariant {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ}
61
+ (_hδ : 0 ≤ δ)
62
+ (heval : ∀ q ∈ Set.Icc a b, |(evaluate q : ℝ) - f q| ≤ (δ : ℝ))
63
+ {s : Interval} (hs : Invariant a b f δ s) :
64
+ Invariant a b f δ (step δ evaluate s) := by
65
+ have hm := midpoint_mem s hs.ordered
66
+ have he := abs_le.mp (heval (midpoint s) ⟨hs.lower.trans hm.1, hm.2.trans hs.upper⟩)
67
+ unfold step
68
+ split_ifs with hd hp hn
69
+ · exact hs
70
+ · have hp' : (δ : ℝ) < evaluate (midpoint s) := by exact_mod_cast hp
71
+ refine ⟨hs.lower.trans hm.1, hs.upper, hm.2, ?_, ?_⟩
72
+ · simp
73
+ · intro _
74
+ exact ⟨by linarith [he.2], (hs.signs (by simpa using hd)).2⟩
75
+ · have hn' : (evaluate (midpoint s) : ℝ) < -(δ : ℝ) := by exact_mod_cast hn
76
+ refine ⟨hs.lower, hm.2.trans hs.upper, hm.1, ?_, ?_⟩
77
+ · simp
78
+ · intro _
79
+ exact ⟨(hs.signs (by simpa using hd)).1, by linarith [he.1]⟩
80
+ · have hp' : (evaluate (midpoint s) : ℝ) ≤ δ := by exact_mod_cast le_of_not_gt hp
81
+ have hn' : -(δ : ℝ) ≤ evaluate (midpoint s) := by exact_mod_cast le_of_not_gt hn
82
+ refine ⟨hs.lower.trans hm.1, hm.2.trans hs.upper, le_rfl, ?_, ?_⟩
83
+ · intro _
84
+ refine ⟨rfl, abs_le.mpr ?_⟩
85
+ constructor <;> linarith [he.1, he.2]
86
+ · simp
87
+
88
+ theorem step_width {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ}
89
+ {s : Interval} (hs : Invariant a b f δ s) :
90
+ width (step δ evaluate s) ≤ width s / 2 := by
91
+ have ho : (s.lo : ℝ) ≤ s.hi := by exact_mod_cast hs.ordered
92
+ unfold step
93
+ split_ifs with hd hp hn
94
+ · have heq := (hs.certified hd).1
95
+ simp only [width, heq, sub_self, zero_div, le_refl]
96
+ · simp only [width, midpoint_cast]
97
+ linarith
98
+ · simp only [width, midpoint_cast]
99
+ linarith
100
+ · simp only [width, sub_self]
101
+ linarith
102
+
103
+ theorem run_invariant {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ}
104
+ (hδ : 0 ≤ δ) (hab : a ≤ b) (ha : 0 ≤ f a) (hb : f b ≤ 0)
105
+ (heval : ∀ q ∈ Set.Icc a b, |(evaluate q : ℝ) - f q| ≤ (δ : ℝ)) (n : ℕ) :
106
+ Invariant a b f δ (run δ evaluate a b n) := by
107
+ induction n with
108
+ | zero => exact initial_invariant hab ha hb
109
+ | succ n ih =>
110
+ change Invariant a b f δ ((step δ evaluate)^[n + 1] (initial a b))
111
+ rw [Function.iterate_succ_apply']
112
+ exact step_invariant hδ heval ih
113
+
114
+ theorem run_width {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ}
115
+ (hδ : 0 ≤ δ) (hab : a ≤ b) (ha : 0 ≤ f a) (hb : f b ≤ 0)
116
+ (heval : ∀ q ∈ Set.Icc a b, |(evaluate q : ℝ) - f q| ≤ (δ : ℝ)) (n : ℕ) :
117
+ width (run δ evaluate a b n) ≤ ((b : ℝ) - a) / 2 ^ n := by
118
+ induction n with
119
+ | zero => simp [run, initial, width]
120
+ | succ n ih =>
121
+ have hw := step_width (evaluate := evaluate) (run_invariant hδ hab ha hb heval n)
122
+ have hrun : run δ evaluate a b (n + 1) = step δ evaluate (run δ evaluate a b n) :=
123
+ Function.iterate_succ_apply' _ _ _
124
+ rw [hrun]
125
+ calc
126
+ width (step δ evaluate (run δ evaluate a b n)) ≤
127
+ width (run δ evaluate a b n) / 2 := hw
128
+ _ ≤ (((b : ℝ) - a) / 2 ^ n) / 2 := div_le_div_of_nonneg_right ih (by norm_num)
129
+ _ = ((b : ℝ) - a) / 2 ^ (n + 1) := by rw [pow_succ, div_div]
130
+
131
+ theorem invariant_residual {a b δ : ℚ} {f : ℝ → ℝ} {L : ℝ}
132
+ (hδ : 0 ≤ δ) (hL : 0 ≤ L)
133
+ (hLip : ∀ x ∈ Set.Icc (a : ℝ) b, ∀ y ∈ Set.Icc (a : ℝ) b,
134
+ |f x - f y| ≤ L * |x - y|)
135
+ {s : Interval} (hs : Invariant a b f δ s) :
136
+ |f (midpoint s)| ≤ 2 * (δ : ℝ) + L * width s := by
137
+ have hl : (a : ℝ) ≤ s.lo := by exact_mod_cast hs.lower
138
+ have hu : (s.hi : ℝ) ≤ b := by exact_mod_cast hs.upper
139
+ have ho : (s.lo : ℝ) ≤ s.hi := by exact_mod_cast hs.ordered
140
+ have hm := midpoint_mem s hs.ordered
141
+ have hmlo : (s.lo : ℝ) ≤ midpoint s := by exact_mod_cast hm.1
142
+ have hmhi : (midpoint s : ℝ) ≤ s.hi := by exact_mod_cast hm.2
143
+ have hw : 0 ≤ width s := sub_nonneg.mpr ho
144
+ by_cases hd : s.settled = true
145
+ · obtain ⟨heq, herr⟩ := hs.certified hd
146
+ have he : midpoint s = s.lo := by simp [midpoint, heq]
147
+ rw [he]
148
+ exact herr.trans (le_add_of_nonneg_right (mul_nonneg hL hw))
149
+ · have hsign := hs.signs (by simpa using hd)
150
+ have hmemb : (midpoint s : ℝ) ∈ Set.Icc (a : ℝ) b := ⟨hl.trans hmlo, hmhi.trans hu⟩
151
+ have hleft := hLip (midpoint s) hmemb s.lo ⟨hl, ho.trans hu⟩
152
+ have hright := hLip (midpoint s) hmemb s.hi ⟨hl.trans ho, hu⟩
153
+ rw [abs_of_nonneg (sub_nonneg.mpr hmlo)] at hleft
154
+ rw [abs_of_nonpos (sub_nonpos.mpr hmhi)] at hright
155
+ have hlw : L * ((midpoint s : ℝ) - s.lo) ≤ L * width s :=
156
+ mul_le_mul_of_nonneg_left (by dsimp [width]; linarith) hL
157
+ have hrw : L * -((midpoint s : ℝ) - s.hi) ≤ L * width s :=
158
+ mul_le_mul_of_nonneg_left (by dsimp [width]; linarith) hL
159
+ have hδ' : 0 ≤ (δ : ℝ) := by exact_mod_cast hδ
160
+ apply abs_le.mpr
161
+ constructor
162
+ · have h := (neg_le_abs (f (midpoint s) - f s.lo)).trans hleft
163
+ linarith [hsign.1]
164
+ · have h := (le_abs_self (f (midpoint s) - f s.hi)).trans hright
165
+ linarith [hsign.2]
166
+
167
+ /-- After `n` steps the returned rational has residual at most numerical
168
+ ambiguity plus the Lipschitz constant times the halved interval width. -/
169
+ theorem run_residual {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ} {L : ℝ}
170
+ (hδ : 0 ≤ δ) (hab : a ≤ b) (ha : 0 ≤ f a) (hb : f b ≤ 0) (hL : 0 ≤ L)
171
+ (heval : ∀ q ∈ Set.Icc a b, |(evaluate q : ℝ) - f q| ≤ (δ : ℝ))
172
+ (hLip : ∀ x ∈ Set.Icc (a : ℝ) b, ∀ y ∈ Set.Icc (a : ℝ) b,
173
+ |f x - f y| ≤ L * |x - y|) (n : ℕ) :
174
+ |f (midpoint (run δ evaluate a b n))| ≤
175
+ 2 * (δ : ℝ) + L * (((b : ℝ) - a) / 2 ^ n) := by
176
+ exact (invariant_residual hδ hL hLip (run_invariant hδ hab ha hb heval n)).trans
177
+ (add_le_add_right (mul_le_mul_of_nonneg_left (run_width hδ hab ha hb heval n) hL) _)
178
+
179
+ theorem run_mem {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ}
180
+ (hδ : 0 ≤ δ) (hab : a ≤ b) (ha : 0 ≤ f a) (hb : f b ≤ 0)
181
+ (heval : ∀ q ∈ Set.Icc a b, |(evaluate q : ℝ) - f q| ≤ (δ : ℝ)) (n : ℕ) :
182
+ midpoint (run δ evaluate a b n) ∈ Set.Icc a b := by
183
+ have hi := run_invariant hδ hab ha hb heval n
184
+ have hm := midpoint_mem _ hi.ordered
185
+ exact ⟨hi.lower.trans hm.1, hm.2.trans hi.upper⟩
186
+
187
+ /-- Binary magnitude bounds give a number of bisection steps linear in
188
+ the requested precision and the magnitude exponent. -/
189
+ theorem run_binary_precision {a b δ : ℚ} {f : ℝ → ℝ} {evaluate : ℚ → ℚ} {L : ℝ}
190
+ (hδ : 0 ≤ δ) (hab : a ≤ b) (ha : 0 ≤ f a) (hb : f b ≤ 0) (hL : 0 ≤ L)
191
+ (heval : ∀ q ∈ Set.Icc a b, |(evaluate q : ℝ) - f q| ≤ (δ : ℝ))
192
+ (hLip : ∀ x ∈ Set.Icc (a : ℝ) b, ∀ y ∈ Set.Icc (a : ℝ) b,
193
+ |f x - f y| ≤ L * |x - y|) (B p : ℕ)
194
+ (hδp : (δ : ℝ) ≤ (2 ^ (p + 2))⁻¹)
195
+ (hLB : L ≤ 2 ^ B) (hwidth : (b : ℝ) - a ≤ 2 ^ B) :
196
+ |f (midpoint (run δ evaluate a b (2 * B + p + 1)))| ≤ (2 ^ p : ℝ)⁻¹ := by
197
+ have hw : 0 ≤ (b : ℝ) - a := sub_nonneg.mpr (by exact_mod_cast hab)
198
+ have hprod : L * ((b : ℝ) - a) ≤ (2 ^ B : ℝ) * 2 ^ B :=
199
+ mul_le_mul hLB hwidth hw (by positivity)
200
+ have hden : 0 ≤ (2 ^ (2 * B + p + 1) : ℝ)⁻¹ := by positivity
201
+ have herror := run_residual hδ hab ha hb hL heval hLip (2 * B + p + 1)
202
+ have hnum := mul_le_mul_of_nonneg_right hprod hden
203
+ have hexact : 2 * (2 ^ (p + 2) : ℝ)⁻¹ +
204
+ (2 ^ B * 2 ^ B) * (2 ^ (2 * B + p + 1) : ℝ)⁻¹ = (2 ^ p : ℝ)⁻¹ := by
205
+ rw [show 2 * B + p + 1 = B + B + (p + 1) by omega]
206
+ simp only [pow_add, pow_succ]
207
+ field_simp
208
+ ring
209
+ calc
210
+ |f (midpoint (run δ evaluate a b (2 * B + p + 1)))| ≤
211
+ 2 * (δ : ℝ) + (L * ((b : ℝ) - a)) * (2 ^ (2 * B + p + 1) : ℝ)⁻¹ := by
212
+ simpa only [div_eq_mul_inv, mul_assoc] using herror
213
+ _ ≤ 2 * (2 ^ (p + 2) : ℝ)⁻¹ +
214
+ (2 ^ B * 2 ^ B) * (2 ^ (2 * B + p + 1) : ℝ)���¹ := by
215
+ linarith
216
+ _ = (2 ^ p : ℝ)⁻¹ := hexact
217
+
218
+ end ContinuumCoulomb.ApproximateBisection
219
+
220
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/AtomicOutputs.lean ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.HydrogenInput
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Nuclei.NuclearPromise
3
+
4
+ namespace OAI
5
+
6
+ /-! Fixed one-electron outputs for the decidable one-spin source branch.
7
+ The only spectral input is the precisely stated published hydrogen bottom. -/
8
+
9
+ noncomputable section
10
+ namespace ContinuumCoulomb
11
+ open MeasureTheory
12
+
13
+ theorem oneElectron_antisymmetric (w : Coulomb.H1Vector 1) : Coulomb.Antisymmetric w := by
14
+ intro p s
15
+ have hp : p=1 := Subsingleton.elim _ _
16
+ subst p
17
+ filter_upwards [] with x
18
+ have hx : Coulomb.permute (1 : Equiv.Perm (Fin 1)) x=x := by ext i; rfl
19
+ simp [hx]
20
+
21
+ def atomicData : UnitNuclearData where
22
+ nuclei := 1
23
+ nuclei_pos := by decide
24
+ position := fun _ => 0
25
+ distinct := fun _ _ _ => Subsingleton.elim _ _
26
+ electrons := 1
27
+ electrons_pos := by decide
28
+
29
+ theorem atomic_form (w : FormState 1) : unitCoulombForm atomicData w = hydrogenForm 0 w.val := by
30
+ have ha (y : Position) : Coulomb.attraction atomicData.toNuclearData.toNuclei y =
31
+ Coulomb.coulombKernel y := by
32
+ unfold Coulomb.attraction
33
+ erw [Fin.sum_univ_one]
34
+ have hr : realPosition (0 : Fin 3 → ℚ)=0 := by ext i; simp [realPosition]
35
+ simp only [atomicData,UnitNuclearData.toNuclearData,NuclearData.toNuclei,
36
+ Nat.cast_one,hr,sub_zero,one_mul]
37
+ have hp : Coulomb.pairEnergy w.val=0 := by simp [Coulomb.pairEnergy]
38
+ change Coulomb.kinetic w.val-Coulomb.nuclearEnergy atomicData.toNuclearData.toNuclei w.val+
39
+ Coulomb.pairEnergy w.val = hydrogenForm 0 w.val
40
+ simp only [hp,add_zero,Coulomb.nuclearEnergy,ha,Fin.sum_univ_one,
41
+ hydrogenForm,singlePoleEnergy,sub_zero]
42
+
43
+ theorem atomic_ground : unitGroundEnergy atomicData = hydrogenEnergy 0 := by
44
+ unfold unitGroundEnergy hydrogenEnergy oneElectronEnergy
45
+ congr 1
46
+ ext e
47
+ constructor
48
+ · rintro ⟨w,hw,rfl⟩
49
+ exact ⟨w.val,hw,congrArg (fun t : ℝ => (t:EReal)) (atomic_form w)⟩
50
+ · rintro ⟨w,hw,rfl⟩
51
+ exact ⟨⟨w,oneElectron_antisymmetric w⟩,hw,
52
+ congrArg (fun t : ℝ => (t:EReal)) (atomic_form ⟨w,oneElectron_antisymmetric w⟩).symm⟩
53
+
54
+ def atomicOutput (yes : Bool) : UnitCoulomb where
55
+ nuclei := [⟨BinaryRational.ofRat 0,BinaryRational.ofRat 0,BinaryRational.ofRat 0⟩]
56
+ electrons := 1
57
+ lower := BinaryRational.ofRat (if yes then 0 else -2)
58
+ upper := BinaryRational.ofRat (if yes then 1 else -1)
59
+
60
+ theorem atomicOutput_valid (yes : Bool) : (atomicOutput yes).Valid := by
61
+ refine ⟨by change 0<1; decide,by change 0<1; decide,?_,?_,?_,?_,?_⟩
62
+ · intro i
63
+ change Fin 1 at i
64
+ fin_cases i
65
+ change (0:ℕ)<1 ∧ (0:ℕ)<1 ∧ (0:ℕ)<1
66
+ decide
67
+ · intro i j _
68
+ apply Fin.ext
69
+ have hi : i.val<1 := i.isLt
70
+ have hj : j.val<1 := j.isLt
71
+ omega
72
+ · cases yes <;> decide
73
+ · cases yes <;> decide
74
+ · cases yes <;> norm_num [atomicOutput]
75
+
76
+ theorem atomicOutput_data (yes : Bool) (h : (atomicOutput yes).Valid) :
77
+ (atomicOutput yes).toData h = atomicData := by
78
+ cases yes <;> unfold UnitCoulomb.toData atomicOutput atomicData <;>
79
+ congr 1 <;> funext i <;> fin_cases i <;>
80
+ ext j <;> fin_cases j <;> norm_num [atomicOutput,UnitCoulomb.toData,atomicData,BinaryPosition.value]
81
+
82
+ theorem atomicOutput_yes (hh : PublishedHydrogenBottom) : atomicOutput true ∈ unitCoulombPromise.yes := by
83
+ refine ⟨atomicOutput_valid true,?_⟩
84
+ rw [atomicOutput_data,atomic_ground,hh]
85
+ simp only [atomicOutput,BinaryRational.value_ofRat,ite_true,Rat.cast_zero]
86
+ change ((-1/2:ℝ):EReal) ≤ ((0:ℝ):EReal)
87
+ exact EReal.coe_le_coe (by norm_num)
88
+
89
+ theorem atomicOutput_no (hh : PublishedHydrogenBottom) : atomicOutput false ∈ unitCoulombPromise.no := by
90
+ refine ⟨atomicOutput_valid false,?_⟩
91
+ rw [atomicOutput_data,atomic_ground,hh]
92
+ simp only [atomicOutput,BinaryRational.value_ofRat,Bool.false_eq_true,ite_false,Rat.cast_neg,Rat.cast_one]
93
+ change ((-1:ℝ):EReal) ≤ ((-1/2:ℝ):EReal)
94
+ exact EReal.coe_le_coe (by norm_num)
95
+
96
+ end ContinuumCoulomb
97
+
98
+ end
99
+
100
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/BoundedFormCross.lean ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.BoundedPotentialOperator
2
+
3
+ namespace OAI
4
+
5
+ /-! Polarization of the actual bounded-potential quadratic form on the
6
+ full weak-H1 graph. -/
7
+
8
+ noncomputable section
9
+ open MeasureTheory
10
+ open scoped BigOperators
11
+ namespace ContinuumCoulomb
12
+
13
+ theorem h1Coordinates_add {n : ℕ} (u v : Coulomb.H1Vector n) :
14
+ h1Coordinates (u.add v) = h1Coordinates u+h1Coordinates v := by
15
+ funext a
16
+ apply Lp.ext
17
+ filter_upwards [(h1Coordinate_memLp (u.add v) a).coeFn_toLp,
18
+ (h1Coordinate_memLp u a).coeFn_toLp, (h1Coordinate_memLp v a).coeFn_toLp,
19
+ Lp.coeFn_add (h1Coordinates u a) (h1Coordinates v a)] with x huv hu hv ha
20
+ change h1Coordinates (u.add v) a x = _ at huv
21
+ change h1Coordinates u a x = _ at hu
22
+ change h1Coordinates v a x = _ at hv
23
+ change h1Coordinates (u.add v) a x = (h1Coordinates u a+h1Coordinates v a) x
24
+ rw [ha]
25
+ simp only [Pi.add_apply]
26
+ rw [hu,hv,huv]
27
+ cases a <;> rfl
28
+
29
+ def graphBoundedCross {n : ℕ}
30
+ (A : Lp ℂ 2 (volume : Measure (Configuration n)) →L[ℝ]
31
+ Lp ℂ 2 (volume : Measure (Configuration n))) (f g : H1Coordinates n) : ℝ :=
32
+ (1/2:ℝ)*(∑ s, ∑ a, inner ℝ (f (Sum.inr (s,a))) (g (Sum.inr (s,a))))+
33
+ ∑ s, inner ℝ (f (Sum.inl s)) (A (g (Sum.inl s)))
34
+
35
+ theorem graphBoundedForm_add {n : ℕ}
36
+ (A : Lp ℂ 2 (volume : Measure (Configuration n)) →L[ℝ]
37
+ Lp ℂ 2 (volume : Measure (Configuration n)))
38
+ (hA : ∀ x y, inner ℝ x (A y) = inner ℝ y (A x)) (f g : H1Coordinates n) :
39
+ graphBoundedForm A (f+g) = graphBoundedForm A f+graphBoundedForm A g+2*graphBoundedCross A f g := by
40
+ have hx (s : SpinConfiguration n) :
41
+ inner ℝ (g (Sum.inl s)) (A (f (Sum.inl s))) =
42
+ inner ℝ (f (Sum.inl s)) (A (g (Sum.inl s))) := hA _ _
43
+ simp only [graphBoundedForm,graphKinetic,graphBoundedCross,Pi.add_apply,
44
+ norm_add_sq_real,map_add,inner_add_left,inner_add_right,hx,
45
+ Finset.sum_add_distrib,← Finset.mul_sum]
46
+ ring
47
+
48
+ theorem boundedPotential_operator_symmetric {n : ℕ} (V : Configuration n → ℝ)
49
+ (hV : Continuous V) (B : ℝ) (hB : ∀ x, |V x| ≤ B)
50
+ (f g : Lp ℂ 2 (volume : Measure (Configuration n))) :
51
+ inner ℝ f (BoundedPotential.operator V hV B hB g) =
52
+ inner ℝ g (BoundedPotential.operator V hV B hB f) := by
53
+ rw [L2.inner_def,L2.inner_def]
54
+ apply integral_congr_ae
55
+ filter_upwards [BoundedPotential.operator_ae V hV B hB f,
56
+ BoundedPotential.operator_ae V hV B hB g] with x hf hg
57
+ rw [hf,hg,← Complex.real_smul,← Complex.real_smul,
58
+ real_inner_smul_right,real_inner_smul_right,real_inner_comm]
59
+
60
+ theorem boundedPotentialForm_add {n : ℕ} (V : Configuration n → ℝ)
61
+ (hV : Continuous V) (B : ℝ) (hB : ∀ x, |V x| ≤ B) (u v : Coulomb.H1Vector n) :
62
+ boundedPotentialForm V (u.add v) = boundedPotentialForm V u+boundedPotentialForm V v+
63
+ 2*graphBoundedCross (BoundedPotential.operator V hV B hB) (h1Coordinates u) (h1Coordinates v) := by
64
+ simp only [boundedPotentialForm_eq_graph V hV B hB,h1Coordinates_add]
65
+ exact graphBoundedForm_add _ (boundedPotential_operator_symmetric V hV B hB) _ _
66
+
67
+
68
+ theorem Lp_real_inner_eq_re {n : ℕ}
69
+ (f g : Lp ℂ 2 (volume : Measure (Configuration n))) :
70
+ inner ℝ f g = (inner ℂ f g).re := by
71
+ rw [L2.inner_def,L2.inner_def]
72
+ have hr := integral_re (L2.integrable_inner (𝕜 := ℂ) f g)
73
+ change (∫ x, (inner ℂ (f x) (g x)).re) = (∫ x, inner ℂ (f x) (g x)).re at hr
74
+ rw [← hr]
75
+ apply integral_congr_ae
76
+ filter_upwards [] with x
77
+ exact real_inner_eq_re_inner ℂ (f x) (g x)
78
+
79
+ def graphComplexCross {n : ℕ}
80
+ (A : Lp ℂ 2 (volume : Measure (Configuration n)) →L[ℝ]
81
+ Lp ℂ 2 (volume : Measure (Configuration n))) (f g : H1Coordinates n) : ℂ :=
82
+ (1/2:ℂ)*(∑ s, ∑ a, inner ℂ (f (Sum.inr (s,a))) (g (Sum.inr (s,a))))+
83
+ ∑ s, inner ℂ (f (Sum.inl s)) (A (g (Sum.inl s)))
84
+
85
+ private theorem re_finite_sum {ι : Type*} [Fintype ι] (z : ι → ℂ) :
86
+ (∑ i, z i).re = ∑ i, (z i).re :=
87
+ map_sum Complex.reLm z Finset.univ
88
+
89
+ theorem graphBoundedCross_eq_re {n : ℕ}
90
+ (A : Lp ℂ 2 (volume : Measure (Configuration n)) →L[ℝ]
91
+ Lp ℂ 2 (volume : Measure (Configuration n))) (f g : H1Coordinates n) :
92
+ graphBoundedCross A f g = (graphComplexCross A f g).re := by
93
+ simp only [graphBoundedCross,graphComplexCross,Lp_real_inner_eq_re,Complex.add_re,
94
+ Complex.mul_re,re_finite_sum]
95
+ norm_num
96
+
97
+ end ContinuumCoulomb
98
+
99
+ end
100
+
101
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/BoundedPotentialOperator.lean ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.H1BoundedForm
2
+
3
+ namespace OAI
4
+
5
+ /-! Actual bounded real multiplication potentials on the weak-H1 graph. -/
6
+
7
+ noncomputable section
8
+ open MeasureTheory
9
+ open scoped BigOperators
10
+ namespace ContinuumCoulomb
11
+ namespace BoundedPotential
12
+
13
+ variable {n : ℕ} (V : Configuration n → ℝ) (hV : Continuous V)
14
+ (B : ℝ) (hB : ∀ x, |V x| ≤ B)
15
+
16
+ include hV hB in
17
+ theorem product_memLp (u : Lp ℂ 2 (volume : Measure (Configuration n))) :
18
+ MemLp (fun x => (V x : ℂ) * u x) 2 := by
19
+ apply (Lp.memLp u).of_le_mul (c := B)
20
+ ((Complex.continuous_ofReal.comp hV).aestronglyMeasurable.mul (Lp.aestronglyMeasurable u))
21
+ filter_upwards [] with x
22
+ change ‖(V x : ℂ) * u x‖ ≤ B * ‖u x‖
23
+ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs]
24
+ exact mul_le_mul_of_nonneg_right (hB x) (norm_nonneg _)
25
+
26
+ def value (u : Lp ℂ 2 (volume : Measure (Configuration n))) :
27
+ Lp ℂ 2 (volume : Measure (Configuration n)) :=
28
+ (product_memLp V hV B hB u).toLp (fun x => (V x : ℂ)*u x)
29
+
30
+ theorem value_ae (u : Lp ℂ 2 (volume : Measure (Configuration n))) :
31
+ value V hV B hB u =ᵐ[volume] fun x => (V x : ℂ)*u x :=
32
+ (product_memLp V hV B hB u).coeFn_toLp
33
+
34
+ private def linear : Lp ℂ 2 (volume : Measure (Configuration n)) →ₗ[ℂ]
35
+ Lp ℂ 2 (volume : Measure (Configuration n)) where
36
+ toFun := value V hV B hB
37
+ map_add' u v := by
38
+ apply Lp.ext
39
+ filter_upwards [value_ae V hV B hB (u+v), value_ae V hV B hB u,
40
+ value_ae V hV B hB v, Lp.coeFn_add u v,
41
+ Lp.coeFn_add (value V hV B hB u) (value V hV B hB v)] with x he hu hv hs ht
42
+ simp only [he, hs, ht, hu, hv, Pi.add_apply]
43
+ ring
44
+ map_smul' c u := by
45
+ change value V hV B hB (c • u) = c • value V hV B hB u
46
+ apply Lp.ext
47
+ filter_upwards [value_ae V hV B hB (c • u), value_ae V hV B hB u,
48
+ Lp.coeFn_smul c u, Lp.coeFn_smul c (value V hV B hB u)] with x he hu hs ht
49
+ simp only [he, hs, ht, hu, Pi.smul_apply, smul_eq_mul]
50
+ ring
51
+
52
+ def operator : Lp ℂ 2 (volume : Measure (Configuration n)) →L[ℝ]
53
+ Lp ℂ 2 (volume : Measure (Configuration n)) :=
54
+ ((linear V hV B hB).mkContinuous B (fun u =>
55
+ Lp.norm_le_mul_norm_of_ae_le_mul (by
56
+ filter_upwards [value_ae V hV B hB u] with x hx
57
+ change ‖value V hV B hB u x‖ ≤ B * ‖u x‖
58
+ rw [hx, norm_mul, Complex.norm_real, Real.norm_eq_abs]
59
+ exact mul_le_mul_of_nonneg_right (hB x) (norm_nonneg _)))).restrictScalars ℝ
60
+
61
+ theorem operator_ae (u : Lp ℂ 2 (volume : Measure (Configuration n))) :
62
+ operator V hV B hB u =ᵐ[volume] fun x => (V x : ℂ)*u x := value_ae V hV B hB u
63
+
64
+ theorem operator_pairing (u : Lp ℂ 2 (volume : Measure (Configuration n))) :
65
+ inner ℝ u (operator V hV B hB u) = ∫ x, V x * ‖u x‖^2 := by
66
+ rw [L2.inner_def]
67
+ apply integral_congr_ae
68
+ filter_upwards [operator_ae V hV B hB u] with x hx
69
+ rw [hx, ← Complex.real_smul, real_inner_smul_right, real_inner_self_eq_norm_sq]
70
+
71
+ end BoundedPotential
72
+ def boundedPotentialForm {n : ℕ} (V : Configuration n → ℝ) (u : Coulomb.H1Vector n) : ℝ :=
73
+ Coulomb.kinetic u + ∑ s, ∫ x, V x * ‖u.value s x‖^2
74
+
75
+ theorem boundedPotentialForm_eq_graph {n : ℕ} (V : Configuration n → ℝ)
76
+ (hV : Continuous V) (B : ℝ) (hB : ∀ x, |V x| ≤ B) (u : Coulomb.H1Vector n) :
77
+ boundedPotentialForm V u =
78
+ graphBoundedForm (BoundedPotential.operator V hV B hB) (h1Coordinates u) := by
79
+ unfold boundedPotentialForm graphBoundedForm
80
+ rw [kinetic_eq_graphKinetic]
81
+ congr 1
82
+ apply Finset.sum_congr rfl
83
+ intro s _
84
+ rw [BoundedPotential.operator_pairing]
85
+ apply integral_congr_ae
86
+ filter_upwards [(h1Coordinate_memLp u (Sum.inl s)).coeFn_toLp] with x hx
87
+ change h1Coordinates u (Sum.inl s) x = u.value s x at hx
88
+ rw [hx]
89
+
90
+ theorem boundedPotential_lower_of_compact (hpublished : PublishedSobolevSmoothDensity)
91
+ {n : ℕ} (V : Configuration n → ℝ) (hV : Continuous V) (B : ℝ)
92
+ (hB : ∀ x, |V x| ≤ B) (E : ℝ)
93
+ (hcompact : ∀ v : Coulomb.H1Vector n,
94
+ (∀ s, ContDiff ℝ 1 (v.value s) ∧ HasCompactSupport (v.value s)) →
95
+ (∀ s a x, v.gradient s a x =
96
+ fderiv ℝ (v.value s) x (EuclideanSpace.single a 1)) →
97
+ E*Coulomb.mass v ≤ boundedPotentialForm V v)
98
+ (u : Coulomb.H1Vector n) : E*Coulomb.mass u ≤ boundedPotentialForm V u := by
99
+ rw [boundedPotentialForm_eq_graph V hV B hB]
100
+ apply boundedForm_lower_of_compact hpublished _ E
101
+ intro v hv hd
102
+ rw [← boundedPotentialForm_eq_graph V hV B hB]
103
+ exact hcompact v hv hd
104
+
105
+ end ContinuumCoulomb
106
+
107
+ end
108
+
109
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisection.lean ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationComponents
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombTargetLipschitz
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.BisectionProgram
4
+
5
+ namespace OAI
6
+
7
+ /-! Deterministic bisection with the concrete hopping/Coulomb evaluator.
8
+ The premises are endpoint signs and the already proved separated-site gap;
9
+ there is no numeric evaluator assumption. -/
10
+
11
+ noncomputable section
12
+ namespace ContinuumCoulomb.CalibratedEvaluation
13
+ open ExactQuantumFactoring.BitStackProgram
14
+
15
+ abbrev BisectionInput := ℕ × (Environment × (ℚ × ℚ))
16
+
17
+ def bisectionInputCode : BisectionInput → List Bool :=
18
+ prodCode unaryCode (prodCode environmentCode (prodCode ratCode ratCode))
19
+
20
+ def tolerance (e : Environment) : ℚ := 1 / ((e.1.2 : ℚ) + 1)
21
+
22
+ def bisectionArgument (x : BisectionInput) : BisectionProgram.Input Environment :=
23
+ (x.1, (x.2.1, (tolerance x.2.1, x.2.2)))
24
+
25
+ def bisect (rho : ℕ) (x : BisectionInput) : ℚ :=
26
+ BisectionProgram.approximate (value rho) (bisectionArgument x)
27
+
28
+ noncomputable opaque bisectionArgumentProgram : Procedure bisectionInputCode
29
+ (BisectionProgram.inputCode environmentCode) bisectionArgument := by
30
+ let n := Procedure.first unaryCode (prodCode environmentCode (prodCode ratCode ratCode))
31
+ let tail := Procedure.second unaryCode (prodCode environmentCode (prodCode ratCode ratCode))
32
+ let env := (Procedure.first environmentCode (prodCode ratCode ratCode)).comp tail
33
+ let ends := (Procedure.second environmentCode (prodCode ratCode ratCode)).comp tail
34
+ let np := (Procedure.first (prodCode unaryCode unaryCode)
35
+ (prodCode unaryCode (prodCode ratCode ratCode))).comp env
36
+ let p := (Procedure.second unaryCode unaryCode).comp np
37
+ let p1 := Procedure.natToRat.comp (Procedure.unaryToBits.comp
38
+ (Procedure.unarySuccessor.comp p))
39
+ let delta := Procedure.ratInv.comp p1
40
+ exact (n.pair (env.pair (delta.pair ends))).congrFun (by
41
+ intro x
42
+ simp only [Function.comp_apply, id_eq, Nat.succ_eq_add_one, bisectionArgument,
43
+ tolerance, one_div, Nat.cast_add, Nat.cast_one]
44
+ )
45
+
46
+ def residual (rho : ℕ) (e : Environment) (d : ℝ) : ℝ :=
47
+ (e.2.1 : ℝ) * planarHopping d -
48
+ coulombHoppingTarget (GaussianFrequency.frequency rho) e.2.2.1 e.2.2.2 d
49
+
50
+ def residualLipschitz (rho : ℕ) (e : Environment) : ℝ :=
51
+ (e.2.1 : ℝ) * planarHoppingLipschitzConstant +
52
+ coulombTargetLipschitzConstant (GaussianFrequency.frequency rho) e.2.2.1 e.2.2.2
53
+
54
+ theorem bisect_residual (rho : ℕ) (hrho : 0 < rho) (e : Environment) (a b : ℚ)
55
+ (hK : 0 ≤ e.2.2.2) (hKN : (e.2.2.2 : ℝ) ≤ e.1.1)
56
+ (hτ : 0 ≤ e.2.2.1) (hτ1 : e.2.2.1 ≤ 1) (hab : a ≤ b)
57
+ (haN : -(e.1.1 : ℝ) ≤ a) (hbN : (b : ℝ) ≤ e.1.1)
58
+ (ha : 0 ≤ residual rho e a) (hb : residual rho e b ≤ 0)
59
+ (hgap : ∀ r ∈ Set.Icc (a : ℝ) b,
60
+ localizedGramConstant (GaussianFrequency.frequency rho) ≤
61
+ localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
62
+ localizedCoulombProfile (GaussianFrequency.frequency rho) r) (n : ℕ) :
63
+ |residual rho e (bisect rho (n, (e, (a, b))))| ≤
64
+ 2 * ((e.1.2 : ℝ) + 1)⁻¹ +
65
+ residualLipschitz rho e * (((b : ℝ) - a) / 2 ^ n) := by
66
+ have hf : 0 < GaussianFrequency.frequency rho := Real.sqrt_pos.mpr (by
67
+ change 0 < 4 * Real.pi * (rho : ℝ)
68
+ positivity)
69
+ have hKr : (0 : ℝ) ≤ e.2.2.2 := by exact_mod_cast hK
70
+ have hτr : (0 : ℝ) ≤ e.2.2.1 := by exact_mod_cast hτ
71
+ have hLip0 : 0 ≤ residualLipschitz rho e := add_nonneg
72
+ (mul_nonneg (Nat.cast_nonneg _) (by positivity))
73
+ (coulombTargetLipschitzConstant_nonnegative _ _ hτr)
74
+ have heval (q : ℚ) (hq : q ∈ Set.Icc a b) :
75
+ |(value rho e q : ℝ) - residual rho e q| ≤ (tolerance e : ℝ) := by
76
+ have hqa : (a : ℝ) ≤ q := by exact_mod_cast hq.1
77
+ have hqb : (q : ℝ) ≤ b := by exact_mod_cast hq.2
78
+ have hqN : |(q : ℝ)| ≤ e.1.1 := abs_le.mpr ⟨haN.trans hqa, hqb.trans hbN⟩
79
+ have hg := (localizedGramConstant_positive hf).le.trans (hgap q ⟨hqa, hqb⟩)
80
+ have he := approximation_error rho hrho e q hK hKN hτ hτ1 hqN hg
81
+ simpa only [residual, coulombHoppingTarget, tolerance, Rat.cast_div,
82
+ Rat.cast_one, Rat.cast_add, Rat.cast_natCast, one_div, Rat.cast_inv] using he
83
+ have hLip (r : ℝ) (hr : r ∈ Set.Icc (a : ℝ) b)
84
+ (s : ℝ) (hs : s ∈ Set.Icc (a : ℝ) b) :
85
+ |residual rho e r - residual rho e s| ≤ residualLipschitz rho e * |r - s| :=
86
+ calibratedResidual_abs_sub hf hτr hKr (Nat.cast_nonneg _) r s (hgap r hr) (hgap s hs)
87
+ have ht : 0 ≤ tolerance e := by unfold tolerance; positivity
88
+ have h := BisectionProgram.residual (value rho) e ht hab ha hb hLip0 heval hLip n
89
+ simpa only [bisect, bisectionArgument, tolerance, Rat.cast_div, Rat.cast_one,
90
+ Rat.cast_add, Rat.cast_natCast, one_div, Rat.cast_inv] using h
91
+
92
+ end ContinuumCoulomb.CalibratedEvaluation
93
+
94
+ end
95
+
96
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisectionLocation.lean ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisectionSchedule
2
+
3
+ namespace OAI
4
+
5
+ /-! Every returned rational remains in its original search interval. This
6
+ geometric invariant does not need an accuracy or residual-sign hypothesis. -/
7
+
8
+ namespace ContinuumCoulomb
9
+
10
+ private theorem bisection_step_nested (δ : ℚ) (evaluate : ℚ → ℚ)
11
+ {a b : ℚ} (s : ApproximateBisection.Interval)
12
+ (hs : a ≤ s.lo ∧ s.lo ≤ s.hi ∧ s.hi ≤ b) :
13
+ a ≤ (ApproximateBisection.step δ evaluate s).lo ∧
14
+ (ApproximateBisection.step δ evaluate s).lo ≤ (ApproximateBisection.step δ evaluate s).hi ∧
15
+ (ApproximateBisection.step δ evaluate s).hi ≤ b := by
16
+ have hm := ApproximateBisection.midpoint_mem s hs.2.1
17
+ unfold ApproximateBisection.step
18
+ split_ifs
19
+ · exact hs
20
+ · exact ⟨hs.1.trans hm.1, hm.2, hs.2.2⟩
21
+ · exact ⟨hs.1, hm.1, hm.2.trans hs.2.2⟩
22
+ · exact ⟨hs.1.trans hm.1, le_rfl, hm.2.trans hs.2.2⟩
23
+
24
+ theorem bisection_run_nested (δ : ℚ) (evaluate : ℚ → ℚ) (a b : ℚ)
25
+ (hab : a ≤ b) (n : ℕ) :
26
+ a ≤ (ApproximateBisection.run δ evaluate a b n).lo ∧
27
+ (ApproximateBisection.run δ evaluate a b n).lo ≤
28
+ (ApproximateBisection.run δ evaluate a b n).hi ∧
29
+ (ApproximateBisection.run δ evaluate a b n).hi ≤ b := by
30
+ induction n with
31
+ | zero => exact ⟨le_rfl, hab, le_rfl⟩
32
+ | succ n ih =>
33
+ simpa only [ApproximateBisection.run, Function.iterate_succ_apply'] using
34
+ bisection_step_nested δ evaluate (ApproximateBisection.run δ evaluate a b n) ih
35
+
36
+ theorem bisection_value_mem {E : Type} (evaluate : E → ℚ → ℚ) (e : E)
37
+ (δ a b : ℚ) (hab : a ≤ b) (n : ℕ) :
38
+ BisectionProgram.approximate evaluate (n, (e, (δ, (a, b)))) ∈ Set.Icc a b := by
39
+ obtain ⟨hp, hi⟩ := BisectionRegisters.iterate_interval δ (evaluate e)
40
+ (BisectionRegisters.initial a b) (BisectionRegisters.initial_den_pos a b) n
41
+ unfold BisectionProgram.approximate
42
+ rw [BisectionRegisters.middle_eq _ hp, hi, BisectionRegisters.initial_interval]
43
+ have hs := bisection_run_nested δ (evaluate e) a b hab n
44
+ have hm := ApproximateBisection.midpoint_mem (ApproximateBisection.run δ (evaluate e) a b n) hs.2.1
45
+ exact ⟨hs.1.trans hm.1, hm.2.trans hs.2.2⟩
46
+
47
+ namespace CalibratedEvaluation
48
+
49
+ theorem bisect_mem (rho : ℕ) (e : Environment) (a b : ℚ) (hab : a ≤ b) (n : ℕ) :
50
+ bisect rho (n, (e, (a, b))) ∈ Set.Icc a b :=
51
+ bisection_value_mem (value rho) e (tolerance e) a b hab n
52
+
53
+ theorem scheduledValue_mem (rho : ℕ) (e : Environment) (a b : ℚ) (hab : a ≤ b) :
54
+ scheduledValue rho e a b ∈ Set.Icc a b :=
55
+ bisect_mem rho (refinedEnvironment e) a b hab (iterations rho e)
56
+
57
+ end CalibratedEvaluation
58
+ end ContinuumCoulomb
59
+
60
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisectionMachine.lean ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisection
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.CalibratedEvaluationProgram
3
+
4
+ namespace OAI
5
+
6
+ /-! Literal bisection with the certified calibrated-residual machine. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb.CalibratedEvaluation
10
+ open ExactQuantumFactoring.BitStackProgram
11
+
12
+ noncomputable opaque bisectionProgram (rho : ℕ) : Procedure bisectionInputCode ratCode (bisect rho) :=
13
+ ((BisectionProgram.program (program rho)).comp bisectionArgumentProgram).congrFun
14
+ (by intro x; rfl)
15
+
16
+ noncomputable def bisectionCertificate (rho : ℕ) :
17
+ Turing.TM2ComputableInPolyTime bisectionInputCode ratCode (bisect rho) :=
18
+ (bisectionProgram rho).toTM2
19
+
20
+
21
+ end ContinuumCoulomb.CalibratedEvaluation
22
+
23
+ end
24
+
25
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedBisectionSchedule.lean ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedLipschitzBound
2
+
3
+ namespace OAI
4
+
5
+ /-! Polynomial unary iteration and evaluation-precision choices for the
6
+ actual calibrated bisection. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb.CalibratedEvaluation
10
+
11
+ def refinedEnvironment (e : Environment) : Environment :=
12
+ ((e.1.1, 8 * (e.1.2 + 1)), e.2)
13
+
14
+ def iterations (rho : ℕ) (e : Environment) : ℕ :=
15
+ 16 * lipschitzGuard rho * (e.2.1 + e.1.1 + 1) * (e.1.1 + 1) * (e.1.2 + 1)
16
+
17
+ def scheduledValue (rho : ℕ) (e : Environment) (a b : ℚ) : ℚ :=
18
+ bisect rho (iterations rho e, (refinedEnvironment e, (a, b)))
19
+
20
+ theorem bisection_scalar_budget {C A N S : ℝ} {n : ℕ}
21
+ (hC : 0 < C) (hA : 0 < A) (hN : 0 ≤ N) (hS : 0 < S)
22
+ (hn : (n : ℝ) = 16 * C * A * (N + 1) * S) :
23
+ 2 * (8 * S + 1)⁻¹ + C * A * (2 * N) / 2 ^ n ≤ S⁻¹ := by
24
+ have hn0 : (0 : ℝ) < n := by rw [hn]; positivity
25
+ have hfirst : 2 * (8 * S + 1)⁻¹ ≤ (4 * S)⁻¹ := by
26
+ apply (mul_inv_le_iff₀ (by positivity)).mpr
27
+ apply (le_inv_mul_iff₀ (by positivity : (0 : ℝ) < 4 * S)).mpr
28
+ linarith
29
+ have hsecond : C * A * (2 * N) / 2 ^ n ≤ (8 * S)⁻¹ := by
30
+ calc
31
+ _ = C * A * (2 * N) * (2 : ℝ)⁻¹ ^ n := by rw [div_eq_mul_inv, inv_pow]
32
+ _ ≤ C * A * (2 * N) * ((n : ℝ) + 1)⁻¹ :=
33
+ mul_le_mul_of_nonneg_left (CoulombQuadratureSchedule.dyadic_le_inverse n) (by positivity)
34
+ _ ≤ C * A * (2 * (N + 1)) * (n : ℝ)⁻¹ := by
35
+ apply mul_le_mul
36
+ · gcongr
37
+ linarith
38
+ · exact inv_anti₀ hn0 (by linarith)
39
+ · positivity
40
+ · positivity
41
+ _ = (8 * S)⁻¹ := by
42
+ rw [hn]
43
+ field_simp [hC.ne', hA.ne', hS.ne', ne_of_gt (show 0 < N + 1 by linarith)]
44
+ ring
45
+ have hs := add_le_add hfirst hsecond
46
+ apply hs.trans
47
+ simp only [mul_inv_rev]
48
+ norm_num
49
+ nlinarith [inv_pos.mpr hS]
50
+
51
+ theorem scheduled_residual (rho : ℕ) (hrho : 0 < rho) (e : Environment) (a b : ℚ)
52
+ (hK : (0 : ℚ) ≤ e.2.2.2) (hKN : (e.2.2.2 : ℝ) ≤ e.1.1)
53
+ (hτ : (0 : ℚ) ≤ e.2.2.1) (hτ1 : e.2.2.1 ≤ 1) (hab : a ≤ b)
54
+ (haN : -(e.1.1 : ℝ) ≤ a) (hbN : (b : ℝ) ≤ e.1.1)
55
+ (ha : 0 ≤ residual rho e a) (hb : residual rho e b ≤ 0)
56
+ (hgap : ∀ r ∈ Set.Icc (a : ℝ) b,
57
+ localizedGramConstant (GaussianFrequency.frequency rho) ≤
58
+ localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
59
+ localizedCoulombProfile (GaussianFrequency.frequency rho) r) :
60
+ |residual rho e (scheduledValue rho e a b)| ≤ ((e.1.2 : ℝ) + 1)⁻¹ := by
61
+ have hK' : (0 : ℝ) ≤ e.2.2.2 := by exact_mod_cast hK
62
+ have hτ1' : (e.2.2.1 : ℝ) ≤ 1 := by exact_mod_cast hτ1
63
+ have he := bisect_residual rho hrho (refinedEnvironment e) a b
64
+ hK hKN hτ hτ1 hab haN hbN ha hb hgap (iterations rho e)
65
+ have hL := residualLipschitz_bound rho e hK' hKN hτ1'
66
+ have hwidth : (0 : ℝ) ≤ b - a := by exact_mod_cast sub_nonneg.mpr hab
67
+ have hwidth' : (b : ℝ) - a ≤ 2 * (e.1.1 : ℝ) := by linarith
68
+ have hcount : (iterations rho e : ℝ) =
69
+ 16 * (lipschitzGuard rho : ℝ) * ((e.2.1 : ℝ) + e.1.1 + 1) *
70
+ ((e.1.1 : ℝ) + 1) * ((e.1.2 : ℝ) + 1) := by
71
+ simp only [iterations, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_add, Nat.cast_one]
72
+ have hC : (0 : ℝ) < lipschitzGuard rho := by exact_mod_cast lipschitzGuard_positive rho
73
+ have hA : (0 : ℝ) < (e.2.1 : ℝ) + e.1.1 + 1 := by positivity
74
+ have hbnd := bisection_scalar_budget hC hA (Nat.cast_nonneg e.1.1)
75
+ (show (0 : ℝ) < e.1.2 + 1 by positivity) hcount
76
+ have hterm : residualLipschitz rho e * (((b : ℝ) - a) / 2 ^ iterations rho e) ≤
77
+ (lipschitzGuard rho : ℝ) * ((e.2.1 : ℝ) + e.1.1 + 1) * (2 * (e.1.1 : ℝ)) /
78
+ 2 ^ iterations rho e := by
79
+ calc
80
+ _ ≤ ((lipschitzGuard rho : ℝ) * ((e.2.1 : ℝ) + e.1.1 + 1)) *
81
+ (((b : ℝ) - a) / 2 ^ iterations rho e) :=
82
+ mul_le_mul_of_nonneg_right hL (div_nonneg hwidth (by positivity))
83
+ _ ≤ _ := by rw [mul_div_assoc]; gcongr
84
+ have he' : |residual rho e (scheduledValue rho e a b)| ≤
85
+ 2 * (8 * ((e.1.2 : ℝ) + 1) + 1)⁻¹ +
86
+ residualLipschitz rho e * (((b : ℝ) - a) / 2 ^ iterations rho e) := by
87
+ simpa only [refinedEnvironment, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_add,
88
+ Nat.cast_one, scheduledValue, residual, residualLipschitz] using he
89
+ exact (he'.trans (add_le_add (le_refl _) hterm)).trans hbnd
90
+
91
+ end ContinuumCoulomb.CalibratedEvaluation
92
+
93
+ end
94
+
95
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedContactCorrectness.lean ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.CalibratedContactProgram
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactPositionArray
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactCalibratedGeometry
4
+
5
+ namespace OAI
6
+
7
+ /-! The composed numerical program outputs the actual rational geometric
8
+ realization of the final mediator graph, in its original vertex order. -/
9
+
10
+ noncomputable section
11
+ namespace ContinuumCoulomb.CalibratedContactProgram
12
+ open ContactMediator
13
+
14
+ def graphInput (d : SquareLatticeHeisenberg) (N P H : ℕ)
15
+ (K : GlobalEdge d → ℚ) : Input :=
16
+ (H, ((N, P), (List.ofFn d.coordinate, (d.bonds.toList, List.ofFn K))))
17
+
18
+ def graphLengths (rho : ℕ) (ε c : ℚ) (k A B N P : ℕ)
19
+ (d : SquareLatticeHeisenberg) (K : GlobalEdge d → ℚ) : GlobalEdge d → ℚ :=
20
+ fun a => AutomaticCalibration.normalizedValue rho ε c k A B (N, (P, K a))
21
+
22
+ theorem raw_graphInput (rho : ℕ) (ε c : ℚ) (k A B N P H : ℕ)
23
+ (d : SquareLatticeHeisenberg) (K : GlobalEdge d → ℚ) :
24
+ rawInput rho ε c k A B (graphInput d N P H K) =
25
+ ContactSourceInputProgram.literalInput d H (graphLengths rho ε c k A B N P d K) := by
26
+ simp only [rawInput, graphInput, AutomaticCalibrationList.value, List.map_ofFn,
27
+ ContactSourceInputProgram.literalInput, Function.comp_def]
28
+ rfl
29
+
30
+ theorem value_graphInput (rho : ℕ) (ε c : ℚ) (k A B N P H : ℕ)
31
+ (d : SquareLatticeHeisenberg) (K : GlobalEdge d → ℚ) :
32
+ value rho ε c k A B (graphInput d N P H K) =
33
+ List.ofFn (fun x => ContactCalibratedGeometry.position d H
34
+ (AutomaticCalibration.spacing c k N) (graphLengths rho ε c k A B N P d K) x) := by
35
+ unfold value
36
+ rw [raw_graphInput]
37
+ exact ContactSourceInputProgram.scaled_literal_array d H
38
+ (AutomaticCalibration.spacing c k N) (graphLengths rho ε c k A B N P d K)
39
+
40
+ theorem graphLengths_scale (rho : ℕ) (ε : ℚ) {c : ℚ} (hc : 0 < c)
41
+ (k A B N P : ℕ) (hN : 0 < N) (d : SquareLatticeHeisenberg)
42
+ (K : GlobalEdge d → ℚ) (a : GlobalEdge d) :
43
+ (AutomaticCalibration.spacing c k N : ℝ) * graphLengths rho ε c k A B N P d K a =
44
+ (AutomaticCalibration.value rho ε c k A B (N, (P, K a)) : ℝ) := by
45
+ have hq := AutomaticCalibration.spacing_positive hc k N hN
46
+ have heq : AutomaticCalibration.spacing c k N *
47
+ graphLengths rho ε c k A B N P d K a =
48
+ AutomaticCalibration.value rho ε c k A B (N, (P, K a)) := by
49
+ unfold graphLengths AutomaticCalibration.normalizedValue
50
+ field_simp [hq.ne']
51
+ exact_mod_cast heq
52
+
53
+ theorem graphLengths_near_one (rho : ℕ) {ε c : ℚ} (hε : 0 ≤ ε) (hc : 0 < c)
54
+ (hεtol : (ε : ℝ) / 2 ≤ contactLengthTolerance) (k A B N P : ℕ)
55
+ (hN : 0 < N) (d : SquareLatticeHeisenberg) (K : GlobalEdge d → ℚ) (a : GlobalEdge d) :
56
+ (graphLengths rho ε c k A B N P d K a : ℝ) ∈
57
+ Set.Icc (1 - contactLengthTolerance) (1 + contactLengthTolerance) := by
58
+ obtain ⟨hl, hu⟩ := AutomaticCalibration.normalizedValue_mem rho hε hc k A B
59
+ (N, (P, K a)) hN
60
+ have hl' : (1 : ℝ) - (ε : ℝ) / 2 ≤ graphLengths rho ε c k A B N P d K a := by
61
+ exact_mod_cast hl
62
+ have hu' : (graphLengths rho ε c k A B N P d K a : ℝ) ≤ 1 + (ε : ℝ) / 2 := by
63
+ exact_mod_cast hu
64
+ constructor <;> linarith
65
+
66
+ theorem graph_separation (rho : ℕ) {ε c : ℚ} (hε : 0 ≤ ε) (hc : 0 < c)
67
+ (hεtol : (ε : ℝ) / 2 ≤ contactLengthTolerance) (k A B N P H W G : ℕ)
68
+ (hN : 0 < N) (hH : 7200 ≤ H) (d : SquareLatticeHeisenberg) (K : GlobalEdge d → ℚ)
69
+ (x y : GlobalSite d) (hxy : x ≠ y) :
70
+ (9 / 10 : ℝ) * AutomaticCalibration.spacing c k N ≤
71
+ dist (ContactCalibratedGeometry.point d H (AutomaticCalibration.spacing c k N)
72
+ (graphLengths rho ε c k A B N P d K) x)
73
+ (ContactCalibratedGeometry.point d H (AutomaticCalibration.spacing c k N)
74
+ (graphLengths rho ε c k A B N P d K) y) :=
75
+ ContactCalibratedGeometry.separation d W G H (AutomaticCalibration.spacing_positive hc k N hN)
76
+ _ hH (graphLengths_near_one rho hε hc hεtol k A B N P hN d K) x y hxy
77
+
78
+ end ContinuumCoulomb.CalibratedContactProgram
79
+
80
+ end
81
+
82
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationBudget.lean ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationParameters
2
+
3
+ namespace OAI
4
+
5
+ /-! A fixed polynomial accuracy schedule for the calibrated hopping
6
+ residual. The square-root input uses quadratic precision in the requested
7
+ inverse error, rather than assuming a spectral gap for numerical samples. -/
8
+
9
+ noncomputable section
10
+ namespace ContinuumCoulomb.CalibratedEvaluation
11
+
12
+ theorem hopping_budget (scale P : ℕ) :
13
+ (scale : ℝ) * ((hoppingPrecision scale P : ℝ) + 1)⁻¹ ≤
14
+ (4 * ((P : ℝ) + 1))⁻¹ := by
15
+ have hP : 0 < (P : ℝ) + 1 := by positivity
16
+ have hprec : (hoppingPrecision scale P : ℝ) =
17
+ 4 * ((scale : ℝ) + 1) * ((P : ℝ) + 1) := by
18
+ simp only [hoppingPrecision, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_add, Nat.cast_one]
19
+ rw [hprec]
20
+ apply (mul_inv_le_iff₀ (by positivity)).mpr
21
+ apply (le_inv_mul_iff₀ (by positivity : (0 : ℝ) < 4 * (P + 1))).mpr
22
+ nlinarith
23
+
24
+ theorem root_budget (P : ℕ) :
25
+ (2 : ℝ)⁻¹ ^ rootPrecision P ≤ (4 * ((P : ℝ) + 1))⁻¹ := by
26
+ apply (CoulombQuadratureSchedule.dyadic_le_inverse _).trans
27
+ apply inv_anti₀ (by positivity)
28
+ simp only [rootPrecision, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_add, Nat.cast_one]
29
+ linarith [show (0 : ℝ) ≤ P from Nat.cast_nonneg _]
30
+
31
+ theorem coulomb_root_budget (N P : ℕ) {K : ℝ} (hKN : K ≤ N) :
32
+ Real.sqrt (2 * K * ((coulombPrecision N P : ℝ) + 1)⁻¹) ≤
33
+ (4 * ((P : ℝ) + 1))⁻¹ := by
34
+ let S := (P : ℝ) + 1
35
+ have hS : 0 < S := by dsimp only [S]; positivity
36
+ have hN : (0 : ℝ) ≤ N := Nat.cast_nonneg _
37
+ have hprec : (coulombPrecision N P : ℝ) = 64 * ((N : ℝ) + 1) * S ^ 2 := by
38
+ simp only [coulombPrecision, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_add, Nat.cast_one,
39
+ Nat.cast_pow, S]
40
+ have hsmall : 2 * K * ((coulombPrecision N P : ℝ) + 1)⁻¹ ≤ ((4 * S)⁻¹) ^ 2 := by
41
+ rw [hprec]
42
+ apply (mul_inv_le_iff₀ (by positivity)).mpr
43
+ have he : ((4 * S)⁻¹) ^ 2 * (64 * ((N : ℝ) + 1) * S ^ 2 + 1) =
44
+ 4 * ((N : ℝ) + 1) + ((4 * S)⁻¹) ^ 2 := by
45
+ field_simp [hS.ne']
46
+ ring
47
+ rw [he]
48
+ nlinarith [sq_nonneg ((4 * S)⁻¹)]
49
+ exact (Real.sqrt_le_sqrt hsmall).trans_eq (by
50
+ rw [Real.sqrt_sq_eq_abs, abs_of_pos (inv_pos.mpr (mul_pos (by norm_num) hS))])
51
+
52
+ end ContinuumCoulomb.CalibratedEvaluation
53
+
54
+ end
55
+
56
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationComponents.lean ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationError
2
+
3
+ namespace OAI
4
+
5
+ /-! An actual polynomial TM2 evaluator for the Coulomb-calibrated residual.
6
+ This is the numeric callback used by deterministic bisection. -/
7
+
8
+ namespace ContinuumCoulomb.CalibratedEvaluation
9
+ open ExactQuantumFactoring.BitStackProgram
10
+
11
+ attribute [local irreducible] CoulombEvaluation.approximate
12
+
13
+ def environmentCode : Environment → List Bool :=
14
+ prodCode (prodCode unaryCode unaryCode) (prodCode unaryCode (prodCode ratCode ratCode))
15
+
16
+ def inputCode : (Environment × ℚ) → List Bool := prodCode environmentCode ratCode
17
+
18
+ noncomputable opaque coulombPrecisionProgram :
19
+ Procedure (prodCode unaryCode unaryCode) unaryCode (fun x => coulombPrecision x.1 x.2) := by
20
+ let n := Procedure.unarySuccessor.comp (Procedure.first unaryCode unaryCode)
21
+ let p := ResolventSchedule.squareProgram.comp
22
+ (Procedure.unarySuccessor.comp (Procedure.second unaryCode unaryCode))
23
+ let prod := ResolventSchedule.mulProgram.comp (n.pair p)
24
+ exact ((CoulombEvaluation.scaleProgram 64).comp prod).congrFun (by
25
+ intro x
26
+ simp only [Function.comp_apply, Nat.succ_eq_add_one, coulombPrecision]
27
+ ring)
28
+
29
+ noncomputable opaque hoppingPrecisionProgram :
30
+ Procedure (prodCode unaryCode unaryCode) unaryCode (fun x => hoppingPrecision x.1 x.2) := by
31
+ let s := Procedure.unarySuccessor.comp (Procedure.first unaryCode unaryCode)
32
+ let p := Procedure.unarySuccessor.comp (Procedure.second unaryCode unaryCode)
33
+ let prod := ResolventSchedule.mulProgram.comp (s.pair p)
34
+ exact ((CoulombEvaluation.scaleProgram 4).comp prod).congrFun (by
35
+ intro x
36
+ simp only [Function.comp_apply, Nat.succ_eq_add_one, hoppingPrecision]
37
+ ring)
38
+
39
+ noncomputable opaque rootPrecisionProgram : Procedure unaryCode unaryCode rootPrecision :=
40
+ ((CoulombEvaluation.scaleProgram 8).comp Procedure.unarySuccessor).congrFun (by intro x; rfl)
41
+
42
+ noncomputable opaque environmentProgram : Procedure inputCode environmentCode Prod.fst :=
43
+ Procedure.first environmentCode ratCode
44
+ noncomputable opaque distanceProgram : Procedure inputCode ratCode Prod.snd :=
45
+ Procedure.second environmentCode ratCode
46
+ noncomputable opaque metadataProgram : Procedure inputCode (prodCode unaryCode unaryCode)
47
+ (fun x => x.1.1) :=
48
+ (Procedure.first (prodCode unaryCode unaryCode)
49
+ (prodCode unaryCode (prodCode ratCode ratCode))).comp environmentProgram
50
+ noncomputable opaque boundProgram : Procedure inputCode unaryCode (fun x => x.1.1.1) :=
51
+ (Procedure.first unaryCode unaryCode).comp metadataProgram
52
+ noncomputable opaque precisionProgram : Procedure inputCode unaryCode (fun x => x.1.1.2) :=
53
+ (Procedure.second unaryCode unaryCode).comp metadataProgram
54
+ noncomputable opaque parametersProgram : Procedure inputCode
55
+ (prodCode unaryCode (prodCode ratCode ratCode)) (fun x => x.1.2) :=
56
+ (Procedure.second (prodCode unaryCode unaryCode)
57
+ (prodCode unaryCode (prodCode ratCode ratCode))).comp environmentProgram
58
+ noncomputable opaque scaleProgram : Procedure inputCode unaryCode (fun x => x.1.2.1) :=
59
+ (Procedure.first unaryCode (prodCode ratCode ratCode)).comp parametersProgram
60
+ noncomputable opaque scalarParametersProgram : Procedure inputCode (prodCode ratCode ratCode)
61
+ (fun x => x.1.2.2) :=
62
+ (Procedure.second unaryCode (prodCode ratCode ratCode)).comp parametersProgram
63
+ noncomputable opaque tauProgram : Procedure inputCode ratCode (fun x => x.1.2.2.1) :=
64
+ (Procedure.first ratCode ratCode).comp scalarParametersProgram
65
+ noncomputable opaque weightProgram : Procedure inputCode ratCode (fun x => x.1.2.2.2) :=
66
+ (Procedure.second ratCode ratCode).comp scalarParametersProgram
67
+ noncomputable opaque coulombAccuracyProgram : Procedure inputCode unaryCode
68
+ (fun x => coulombPrecision x.1.1.1 x.1.1.2) :=
69
+ coulombPrecisionProgram.comp metadataProgram
70
+ noncomputable def onsiteArgument (x : Environment × ℚ) : CoulombEvaluation.Input :=
71
+ (coulombPrecision x.1.1.1 x.1.1.2, 0)
72
+ noncomputable def separatedArgument (x : Environment × ℚ) : CoulombEvaluation.Input :=
73
+ (coulombPrecision x.1.1.1 x.1.1.2, x.2)
74
+
75
+ noncomputable opaque onsiteArgumentProgram :
76
+ Procedure inputCode CoulombEvaluation.inputCode onsiteArgument :=
77
+ coulombAccuracyProgram.pair (Procedure.constant inputCode ratCode 0)
78
+ noncomputable opaque separatedArgumentProgram :
79
+ Procedure inputCode CoulombEvaluation.inputCode separatedArgument :=
80
+ coulombAccuracyProgram.pair distanceProgram
81
+
82
+ noncomputable opaque onsiteRawProgram (rho : ℕ) : Procedure inputCode ratCode
83
+ ((fun q : CoulombEvaluation.Input => CoulombEvaluation.approximate rho q.1 q.2) ∘ onsiteArgument) :=
84
+ (CoulombEvaluation.program rho).comp onsiteArgumentProgram
85
+ noncomputable opaque separatedRawProgram (rho : ℕ) : Procedure inputCode ratCode
86
+ ((fun q : CoulombEvaluation.Input => CoulombEvaluation.approximate rho q.1 q.2) ∘ separatedArgument) :=
87
+ (CoulombEvaluation.program rho).comp separatedArgumentProgram
88
+
89
+ noncomputable opaque onsiteProgram (rho : ℕ) : Procedure inputCode ratCode
90
+ (fun x => CoulombEvaluation.approximate rho (coulombPrecision x.1.1.1 x.1.1.2) 0) :=
91
+ (onsiteRawProgram rho).congrFun (by intro x; simp only [Function.comp_apply, onsiteArgument])
92
+ noncomputable opaque separatedProgram (rho : ℕ) : Procedure inputCode ratCode
93
+ (fun x => CoulombEvaluation.approximate rho (coulombPrecision x.1.1.1 x.1.1.2) x.2) :=
94
+ (separatedRawProgram rho).congrFun (by intro x; simp only [Function.comp_apply, separatedArgument])
95
+
96
+ noncomputable opaque gapProgram (rho : ℕ) : Procedure inputCode ratCode
97
+ (fun x => gap rho x.1.1.1 x.1.1.2 x.2) :=
98
+ (CappedKernelProgram.maximumProgram.comp ((Procedure.constant inputCode ratCode 0).pair
99
+ (Procedure.ratSub.comp ((onsiteProgram rho).pair (separatedProgram rho))))).congrFun
100
+ (by intro x; rfl)
101
+ noncomputable opaque radicandProgram (rho : ℕ) : Procedure inputCode ratCode
102
+ (fun x => x.1.2.2.2 * gap rho x.1.1.1 x.1.1.2 x.2) :=
103
+ Procedure.ratMul.comp (weightProgram.pair (gapProgram rho))
104
+ noncomputable opaque rootProgram (rho : ℕ) : Procedure inputCode ratCode
105
+ (fun x => root rho x.1.1.1 x.1.1.2 x.1.2.2.2 x.2) :=
106
+ (RationalSquareRoot.program.comp
107
+ ((rootPrecisionProgram.comp precisionProgram).pair (radicandProgram rho))).congrFun
108
+ (by intro x; rfl)
109
+ noncomputable opaque hoppingAccuracyProgram : Procedure inputCode unaryCode
110
+ (fun x => hoppingPrecision x.1.2.1 x.1.1.2) :=
111
+ hoppingPrecisionProgram.comp (scaleProgram.pair precisionProgram)
112
+ noncomputable opaque hoppingProgram : Procedure inputCode ratCode
113
+ (fun x => ComputableHopping.approximate ((x.1.1.1, hoppingPrecision x.1.2.1 x.1.1.2), x.2)) :=
114
+ ComputableHopping.program.comp ((boundProgram.pair hoppingAccuracyProgram).pair distanceProgram)
115
+ noncomputable opaque scaledHoppingProgram : Procedure inputCode ratCode
116
+ (fun x => (x.1.2.1 : ℚ) *
117
+ ComputableHopping.approximate ((x.1.1.1, hoppingPrecision x.1.2.1 x.1.1.2), x.2)) :=
118
+ Procedure.ratMul.comp ((Procedure.natToRat.comp
119
+ (Procedure.unaryToBits.comp scaleProgram)).pair hoppingProgram)
120
+ noncomputable opaque targetProgram (rho : ℕ) : Procedure inputCode ratCode
121
+ (fun x => x.1.2.2.1 * root rho x.1.1.1 x.1.1.2 x.1.2.2.2 x.2) :=
122
+ Procedure.ratMul.comp (tauProgram.pair (rootProgram rho))
123
+
124
+ end ContinuumCoulomb.CalibratedEvaluation
125
+
126
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationError.lean ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedEvaluationBudget
2
+
3
+ namespace OAI
4
+
5
+ /-! Certified evaluation of the actual calibrated hopping residual,
6
+ uniformly on rational points in a bounded interval. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb.CalibratedEvaluation
10
+
11
+ theorem approximation_error (rho : ℕ) (hrho : 0 < rho) (e : Environment) (d : ℚ)
12
+ (hK : (0 : ℚ) ≤ e.2.2.2) (hKN : (e.2.2.2 : ℝ) ≤ e.1.1)
13
+ (hτ : (0 : ℚ) ≤ e.2.2.1) (hτ1 : e.2.2.1 ≤ 1)
14
+ (hd : |(d : ℝ)| ≤ (e.1.1 : ℝ))
15
+ (hgap : 0 ≤ localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
16
+ localizedCoulombProfile (GaussianFrequency.frequency rho) (d : ℝ)) :
17
+ |(value rho e d : ℝ) -
18
+ ((e.2.1 : ℝ) * planarHopping (d : ℝ) - (e.2.2.1 : ℝ) *
19
+ Real.sqrt ((e.2.2.2 : ℝ) *
20
+ (localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
21
+ localizedCoulombProfile (GaussianFrequency.frequency rho) (d : ℝ))))| ≤
22
+ ((e.1.2 : ℝ) + 1)⁻¹ := by
23
+ have hKr : (0 : ℝ) ≤ e.2.2.2 := by exact_mod_cast hK
24
+ have hτr : (0 : ℝ) ≤ e.2.2.1 := by exact_mod_cast hτ
25
+ have hτ1r : (e.2.2.1 : ℝ) ≤ 1 := by exact_mod_cast hτ1
26
+ have hu := CoulombEvaluation.approximation_error rho (coulombPrecision e.1.1 e.1.2) hrho 0
27
+ have hv := CoulombEvaluation.approximation_error rho (coulombPrecision e.1.1 e.1.2) hrho d
28
+ simp only [Rat.cast_zero] at hu
29
+ have ht := ComputableHopping.approximation_error
30
+ ((e.1.1, hoppingPrecision e.2.1 e.1.2), d) hd
31
+ have hq : (0 : ℚ) ≤ e.2.2.2 * gap rho e.1.1 e.1.2 d :=
32
+ mul_nonneg hK (le_max_left _ _)
33
+ have hr := RationalSquareRoot.value_error (rootPrecision e.1.2) hq
34
+ have hr' : |(root rho e.1.1 e.1.2 e.2.2.2 d : ℝ) -
35
+ Real.sqrt ((e.2.2.2 : ℝ) * max 0
36
+ ((CoulombEvaluation.approximate rho (coulombPrecision e.1.1 e.1.2) 0 : ℝ) -
37
+ CoulombEvaluation.approximate rho (coulombPrecision e.1.1 e.1.2) d))| ≤
38
+ (2 : ℝ)⁻¹ ^ rootPrecision e.1.2 := by
39
+ simpa only [root, gap, Rat.cast_mul, Rat.cast_max, Rat.cast_zero, Rat.cast_sub] using hr
40
+ have he := calibrated_residual_error (Nat.cast_nonneg e.2.1) hτr hKr hgap ht hu hv hr'
41
+ have hhop := hopping_budget e.2.1 e.1.2
42
+ have hroot := root_budget e.1.2
43
+ have hcoulomb := coulomb_root_budget e.1.1 e.1.2 hKN
44
+ have hnonneg : 0 ≤ (2 : ℝ)⁻¹ ^ rootPrecision e.1.2 +
45
+ Real.sqrt (2 * (e.2.2.2 : ℝ) * ((coulombPrecision e.1.1 e.1.2 : ℝ) + 1)⁻¹) := by
46
+ positivity
47
+ have htarget := mul_le_mul_of_nonneg_right hτ1r hnonneg
48
+ have hfinal := he.trans (add_le_add hhop
49
+ (htarget.trans (by simpa only [one_mul] using add_le_add hroot hcoulomb)))
50
+ have hsum : (4 * ((e.1.2 : ℝ) + 1))⁻¹ +
51
+ ((4 * ((e.1.2 : ℝ) + 1))⁻¹ + (4 * ((e.1.2 : ℝ) + 1))⁻¹) =
52
+ 3 * (4 * ((e.1.2 : ℝ) + 1))⁻¹ := by ring
53
+ have hout : |(value rho e d : ℝ) -
54
+ ((e.2.1 : ℝ) * planarHopping (d : ℝ) - (e.2.2.1 : ℝ) *
55
+ Real.sqrt ((e.2.2.2 : ℝ) *
56
+ (localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
57
+ localizedCoulombProfile (GaussianFrequency.frequency rho) (d : ℝ))))| ≤
58
+ 3 * (4 * ((e.1.2 : ℝ) + 1))⁻¹ := by
59
+ simpa only [value, Rat.cast_sub, Rat.cast_mul, Rat.cast_natCast, hsum] using hfinal
60
+ apply hout.trans
61
+ rw [mul_inv]
62
+ norm_num
63
+ nlinarith [inv_pos.mpr (show (0 : ℝ) < e.1.2 + 1 by positivity)]
64
+
65
+ end ContinuumCoulomb.CalibratedEvaluation
66
+
67
+ end
68
+
69
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedEvaluationParameters.lean ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.CoulombEvaluationProgram
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Reduction.ComputableHopping
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationSquareError
4
+
5
+ namespace OAI
6
+
7
+ /-! The literal scalar function supplied to calibrated-distance bisection.
8
+ The displacement/weight bound, amplification and requested accuracy are unary;
9
+ the positive target parameters and the queried distance are rational. -/
10
+
11
+ namespace ContinuumCoulomb.CalibratedEvaluation
12
+
13
+ abbrev Environment := (ℕ × ℕ) × (ℕ × (ℚ × ℚ))
14
+
15
+ noncomputable def coulombPrecision (N P : ℕ) : ℕ := 64 * (N + 1) * (P + 1) ^ 2
16
+ noncomputable def hoppingPrecision (scale P : ℕ) : ℕ := 4 * (scale + 1) * (P + 1)
17
+ noncomputable def rootPrecision (P : ℕ) : ℕ := 8 * (P + 1)
18
+
19
+ noncomputable def gap (rho N P : ℕ) (d : ℚ) : ℚ :=
20
+ max 0 (CoulombEvaluation.approximate rho (coulombPrecision N P) 0 -
21
+ CoulombEvaluation.approximate rho (coulombPrecision N P) d)
22
+
23
+ noncomputable def root (rho N P : ℕ) (K d : ℚ) : ℚ :=
24
+ RationalSquareRoot.value (rootPrecision P, K * gap rho N P d)
25
+
26
+ noncomputable def value (rho : ℕ) (e : Environment) (d : ℚ) : ℚ :=
27
+ (e.2.1 : ℚ) * ComputableHopping.approximate
28
+ ((e.1.1, hoppingPrecision e.2.1 e.1.2), d) -
29
+ e.2.2.1 * root rho e.1.1 e.1.2 e.2.2.2 d
30
+
31
+ end ContinuumCoulomb.CalibratedEvaluation
32
+
33
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedGraphError.lean ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationGraphBudget
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisectionLocation
3
+
4
+ namespace OAI
5
+
6
+ /-! The actual scheduled rational distances produce a finite Hubbard
7
+ superexchange graph whose ground energy is close to the requested spin graph.
8
+ Only the analytic endpoint signs and separated-site gap are hypotheses. -/
9
+
10
+ noncomputable section
11
+ namespace ContinuumCoulomb.CalibratedEvaluation
12
+ open scoped BigOperators
13
+
14
+ def edgeEnvironment (N P scale : ℕ) (τ K : ℚ) : Environment := ((N, P), (scale, (τ, K)))
15
+
16
+ def scheduledDistance (rho N P scale : ℕ) (τ K a b : ℚ) : ℚ :=
17
+ scheduledValue rho (edgeEnvironment N P scale τ K) a b
18
+
19
+ def scheduledCoefficient (rho N P scale : ℕ) (τ K a b : ℚ) : ℝ :=
20
+ ((scale : ℝ) * planarHopping (scheduledDistance rho N P scale τ K a b)) ^ 2 /
21
+ (localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
22
+ localizedCoulombProfile (GaussianFrequency.frequency rho)
23
+ (scheduledDistance rho N P scale τ K a b))
24
+
25
+ theorem scheduled_graphSourceBottom_error {Edge : Type*} [Fintype Edge]
26
+ (rho : ℕ) (hrho : 0 < rho) (m : ℕ) (left right : Edge → Fin (m + 1))
27
+ (N P scale : ℕ) (τ : ℚ) (K a b : Edge → ℚ)
28
+ (hK : ∀ e, 0 ≤ K e) (hKN : ∀ e, (K e : ℝ) ≤ N)
29
+ (hτ : 0 ≤ τ) (hτ1 : τ ≤ 1) (hab : ∀ e, a e ≤ b e)
30
+ (haN : ∀ e, -(N : ℝ) ≤ a e) (hbN : ∀ e, (b e : ℝ) ≤ N)
31
+ (ha : ∀ e, 0 ≤ residual rho (edgeEnvironment N P scale τ (K e)) (a e))
32
+ (hb : ∀ e, residual rho (edgeEnvironment N P scale τ (K e)) (b e) ≤ 0)
33
+ (hgap : ∀ e r, r ∈ Set.Icc (a e : ℝ) (b e) →
34
+ localizedGramConstant (GaussianFrequency.frequency rho) ≤
35
+ localizedCoulombProfile (GaussianFrequency.frequency rho) 0 -
36
+ localizedCoulombProfile (GaussianFrequency.frequency rho) r) :
37
+ |HubbardGlobal.graphSourceBottom m left right
38
+ (fun e => scheduledCoefficient rho N P scale τ (K e) (a e) (b e)) -
39
+ HubbardGlobal.graphSourceBottom m left right (fun e => (τ : ℝ) ^ 2 * K e)| ≤
40
+ 4 * Fintype.card Edge *
41
+ (((P : ℝ) + 1)⁻¹ *
42
+ (2 * Real.sqrt ((N : ℝ) * localizedCoulombProfile (GaussianFrequency.frequency rho) 0) +
43
+ ((P : ℝ) + 1)⁻¹) / localizedGramConstant (GaussianFrequency.frequency rho)) := by
44
+ let freq := GaussianFrequency.frequency rho
45
+ let d : Edge → ℚ := fun e => scheduledDistance rho N P scale τ (K e) (a e) (b e)
46
+ let t : Edge → ℝ := fun e => (scale : ℝ) * planarHopping (d e)
47
+ let gap : Edge → ℝ := fun e => localizedCoulombProfile freq 0 - localizedCoulombProfile freq (d e)
48
+ have hfreq : 0 < freq := Real.sqrt_pos.mpr (by
49
+ change 0 < 4 * Real.pi * (rho : ℝ)
50
+ positivity)
51
+ have hmem (e : Edge) : (d e : ℝ) ∈ Set.Icc (a e : ℝ) (b e) := by
52
+ have hm := scheduledValue_mem rho (edgeEnvironment N P scale τ (K e)) (a e) (b e) (hab e)
53
+ exact ⟨by exact_mod_cast hm.1, by exact_mod_cast hm.2⟩
54
+ have hgap' (e : Edge) : localizedGramConstant freq ≤ gap e := hgap e (d e) (hmem e)
55
+ have hU (e : Edge) : gap e ≤ localizedCoulombProfile freq 0 := by
56
+ have hp : 0 ≤ localizedCoulombProfile freq (d e) := by
57
+ unfold localizedCoulombProfile
58
+ rw [localizedCoulombProfileAt_eq]
59
+ exact localizedCoulombCoeff_nonnegative _ _ _
60
+ dsimp only [gap]
61
+ linarith
62
+ have hres (e : Edge) :
63
+ |t e - (τ : ℝ) * Real.sqrt ((K e : ℝ) * gap e)| ≤ ((P : ℝ) + 1)⁻¹ := by
64
+ have hs := scheduled_residual rho hrho (edgeEnvironment N P scale τ (K e))
65
+ (a e) (b e) (hK e) (hKN e) hτ hτ1 (hab e) (haN e) (hbN e) (ha e) (hb e) (hgap e)
66
+ simpa only [residual, coulombHoppingTarget, edgeEnvironment, d, t, gap, freq,
67
+ scheduledDistance] using hs
68
+ have hKr (e : Edge) : (0 : ℝ) ≤ K e := by exact_mod_cast hK e
69
+ have hτr : (0 : ℝ) ≤ τ := by exact_mod_cast hτ
70
+ have hτr1 : (τ : ℝ) ≤ 1 := by exact_mod_cast hτ1
71
+ have h := HubbardGlobal.calibrated_graphSourceBottom_uniform_error m left right
72
+ t (fun e => (K e : ℝ)) gap hKr hKN (localizedGramConstant_positive hfreq)
73
+ hgap' hU hτr hτr1 hres
74
+ simpa only [scheduledCoefficient, scheduledDistance, t, gap, d, freq] using h
75
+
76
+ end ContinuumCoulomb.CalibratedEvaluation
77
+
78
+ end
79
+
80
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedHoppingBound.lean ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedHubbard
2
+
3
+ namespace OAI
4
+
5
+ /-! Explicit total hopping bounds for actual Coulomb-calibrated contacts. -/
6
+
7
+ noncomputable section
8
+ open scoped BigOperators
9
+ namespace ContinuumCoulomb
10
+
11
+ theorem calibrated_hopping_sum_bound {Edge : Type*} [Fintype Edge]
12
+ (freq scale τ B : ℝ) (hτ : 0 ≤ τ) (distance K : Edge → ℝ)
13
+ (hK : ∀ e, 0 ≤ K e) (hB : ∀ e, K e ≤ B)
14
+ (hcal : ∀ e, scale * planarHopping (distance e) = coulombHoppingTarget freq τ (K e) (distance e)) :
15
+ 4 * ∑ e, |scale * planarHopping (distance e)| ≤
16
+ 4 * (Fintype.card Edge : ℝ) * (τ * Real.sqrt (B * localizedCoulombProfile freq 0)) := by
17
+ have hpoint (e : Edge) : |scale * planarHopping (distance e)| ≤
18
+ τ * Real.sqrt (B * localizedCoulombProfile freq 0) := by
19
+ rw [hcal e, coulombHoppingTarget, abs_of_nonneg (mul_nonneg hτ (Real.sqrt_nonneg _))]
20
+ apply mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt ?_) hτ
21
+ calc
22
+ _ ≤ K e * localizedCoulombProfile freq 0 := mul_le_mul_of_nonneg_left
23
+ (sub_le_self _ (localizedCoulombProfile_nonnegative freq (distance e))) (hK e)
24
+ _ ≤ _ := mul_le_mul_of_nonneg_right (hB e) (localizedCoulombProfile_nonnegative freq 0)
25
+ have h := mul_le_mul_of_nonneg_left
26
+ (Finset.sum_le_sum (s := Finset.univ) (fun e _ => hpoint e)) (by norm_num : (0 : ℝ) ≤ 4)
27
+ simpa only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_assoc] using h
28
+
29
+ def calibratedTau (freq ε B : ℝ) (r : ℕ) : ℝ :=
30
+ ε * localizedGramConstant freq /
31
+ (4 * ((r : ℝ) + 1) * (Real.sqrt (B * localizedCoulombProfile freq 0) + 1))
32
+
33
+ theorem calibratedTau_nonnegative {freq ε B : ℝ} (hfreq : 0 < freq) (hε : 0 ≤ ε) (r : ℕ) :
34
+ 0 ≤ calibratedTau freq ε B r := by
35
+ unfold calibratedTau
36
+ exact div_nonneg (mul_nonneg hε (localizedGramConstant_positive hfreq).le) (by positivity)
37
+
38
+ theorem calibratedTau_budget {freq ε B : ℝ} (hfreq : 0 < freq) (hε : 0 ≤ ε) (r : ℕ) :
39
+ 4 * (r : ℝ) * (calibratedTau freq ε B r * Real.sqrt (B * localizedCoulombProfile freq 0)) ≤
40
+ ε * localizedGramConstant freq := by
41
+ let q := Real.sqrt (B * localizedCoulombProfile freq 0)
42
+ have hq : 0 ≤ q := Real.sqrt_nonneg _
43
+ have hd : 0 < 4 * ((r : ℝ) + 1) * (q + 1) := by positivity
44
+ have hεc : 0 ≤ ε * localizedGramConstant freq :=
45
+ mul_nonneg hε (localizedGramConstant_positive hfreq).le
46
+ have hratio : 4 * (r : ℝ) * q ≤ 4 * ((r : ℝ) + 1) * (q + 1) := by
47
+ nlinarith [Nat.cast_nonneg (α := ℝ) r]
48
+ unfold calibratedTau
49
+ change 4 * (r : ℝ) * (ε * localizedGramConstant freq / (4 * ((r : ℝ) + 1) * (q + 1)) * q) ≤ _
50
+ rw [show 4 * (r : ℝ) * (ε * localizedGramConstant freq / (4 * ((r : ℝ) + 1) * (q + 1)) * q) =
51
+ (ε * localizedGramConstant freq) * (4 * (r : ℝ) * q) / (4 * ((r : ℝ) + 1) * (q + 1)) by ring]
52
+ exact (div_le_iff₀ hd).mpr (mul_le_mul_of_nonneg_left hratio hεc)
53
+
54
+ end ContinuumCoulomb
55
+
56
+ end
57
+
58
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedLipschitzBound.lean ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibratedBisection
2
+
3
+ namespace OAI
4
+
5
+ /-! A fixed unary guard bounds the actual residual modulus by a polynomial
6
+ in the displacement/weight bound and the amplification. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb.CalibratedEvaluation
10
+
11
+ def targetModulusBase (rho : ℕ) : ℝ :=
12
+ localizedCoulombLipschitzConstant (GaussianFrequency.frequency rho) /
13
+ (2 * Real.sqrt (localizedGramConstant (GaussianFrequency.frequency rho)))
14
+
15
+ def lipschitzGuard (rho : ℕ) : ℕ :=
16
+ ⌈(planarHoppingLipschitzConstant : ℝ) + targetModulusBase rho⌉₊ + 1
17
+
18
+ theorem targetModulusBase_nonnegative (rho : ℕ) : 0 ≤ targetModulusBase rho :=
19
+ div_nonneg (localizedCoulombLipschitzConstant_nonnegative _)
20
+ (mul_nonneg (by norm_num) (Real.sqrt_nonneg _))
21
+
22
+ theorem lipschitzGuard_bound (rho : ℕ) :
23
+ (planarHoppingLipschitzConstant : ℝ) + targetModulusBase rho ≤ lipschitzGuard rho := by
24
+ have h := Nat.le_ceil ((planarHoppingLipschitzConstant : ℝ) + targetModulusBase rho)
25
+ simp only [lipschitzGuard, Nat.cast_add, Nat.cast_one]
26
+ linarith
27
+
28
+ theorem lipschitzGuard_positive (rho : ℕ) : 0 < lipschitzGuard rho := by
29
+ unfold lipschitzGuard
30
+ omega
31
+
32
+ theorem residualLipschitz_bound (rho : ℕ) (e : Environment)
33
+ (hK : (0 : ℝ) ≤ e.2.2.2) (hKN : (e.2.2.2 : ℝ) ≤ e.1.1)
34
+ (hτ1 : (e.2.2.1 : ℝ) ≤ 1) :
35
+ residualLipschitz rho e ≤
36
+ (lipschitzGuard rho : ℝ) * ((e.2.1 : ℝ) + e.1.1 + 1) := by
37
+ have hH : 0 ≤ (planarHoppingLipschitzConstant : ℝ) := NNReal.coe_nonneg _
38
+ have hA := targetModulusBase_nonnegative rho
39
+ have hN : (0 : ℝ) ≤ e.1.1 := Nat.cast_nonneg _
40
+ have hS : (0 : ℝ) ≤ e.2.1 := Nat.cast_nonneg _
41
+ have hroot : Real.sqrt (e.2.2.2 : ℝ) ≤ (e.1.1 : ℝ) + 1 := by
42
+ have hs := Real.sqrt_nonneg (e.2.2.2 : ℝ)
43
+ have he := Real.sq_sqrt hK
44
+ nlinarith [sq_nonneg (Real.sqrt (e.2.2.2 : ℝ) - 1)]
45
+ have hprod : (e.2.2.1 : ℝ) * Real.sqrt (e.2.2.2 : ℝ) ≤ (e.1.1 : ℝ) + 1 :=
46
+ (mul_le_mul_of_nonneg_right hτ1 (Real.sqrt_nonneg _)).trans
47
+ (by simpa only [one_mul] using hroot)
48
+ have htarget : coulombTargetLipschitzConstant (GaussianFrequency.frequency rho)
49
+ e.2.2.1 e.2.2.2 =
50
+ ((e.2.2.1 : ℝ) * Real.sqrt (e.2.2.2 : ℝ)) * targetModulusBase rho := by
51
+ unfold coulombTargetLipschitzConstant targetModulusBase
52
+ ring
53
+ have htargetBound := mul_le_mul_of_nonneg_right hprod hA
54
+ have hguard := mul_le_mul_of_nonneg_right (lipschitzGuard_bound rho)
55
+ (show (0 : ℝ) ≤ (e.2.1 : ℝ) + e.1.1 + 1 by positivity)
56
+ unfold residualLipschitz
57
+ rw [htarget]
58
+ have hcross : 0 ≤ (planarHoppingLipschitzConstant : ℝ) * ((e.1.1 : ℝ) + 1) +
59
+ targetModulusBase rho * (e.2.1 : ℝ) := by positivity
60
+ nlinarith
61
+
62
+ end ContinuumCoulomb.CalibratedEvaluation
63
+
64
+ end
65
+
66
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibratedMatrixError.lean ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.ManyBody.FockGraphEntries
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.ContactCalibratedGeometry
3
+
4
+ namespace OAI
5
+
6
+ /-! The approximate edge calibrations control the entire hopping matrix.
7
+ Simplicity prevents an edge error from acquiring a graph-size factor. -/
8
+
9
+ noncomputable section
10
+ namespace ContinuumCoulomb.HubbardGlobal
11
+ variable {Edge : Type*} [Fintype Edge]
12
+
13
+ theorem graphHoppingMatrix_stability (m : ℕ) (left right : Edge → Fin (m+1))
14
+ (hloop : ∀ e, left e ≠ right e)
15
+ (hsimple : ∀ e f, e ≠ f →
16
+ ¬(left e=left f ∧ right e=right f) ∧ ¬(left e=right f ∧ right e=left f))
17
+ (t s : Edge → ℂ) {ε : ℝ} (hε : 0 ≤ ε)
18
+ (hedge : ∀ e, ‖t e-s e‖ ≤ ε) (i j : Fin (m+1)) :
19
+ ‖graphHoppingMatrix m left right t i j-graphHoppingMatrix m left right s i j‖ ≤ ε := by
20
+ classical
21
+ by_cases hij : i=j
22
+ · subst j
23
+ rw [graphHoppingMatrix_diagonal m left right t hloop,
24
+ graphHoppingMatrix_diagonal m left right s hloop,sub_self,norm_zero]
25
+ exact hε
26
+ by_cases he : ∃ e, (i=left e ∧ j=right e) ∨ (i=right e ∧ j=left e)
27
+ · obtain ⟨e,he|he⟩ := he
28
+ · rcases he with ⟨rfl,rfl⟩
29
+ simpa only [graphHoppingMatrix_edge m left right _ hloop hsimple] using hedge e
30
+ · rcases he with ⟨rfl,rfl⟩
31
+ rw [graphHoppingMatrix_symmetric m left right t,
32
+ graphHoppingMatrix_symmetric m left right s]
33
+ simpa only [graphHoppingMatrix_edge m left right _ hloop hsimple] using hedge e
34
+ · have hn : ∀ e, ¬(i=left e ∧ j=right e) ∧ ¬(i=right e ∧ j=left e) := by
35
+ intro e
36
+ exact ⟨fun h => he ⟨e,Or.inl h⟩,fun h => he ⟨e,Or.inr h⟩⟩
37
+ rw [graphHoppingMatrix_nonedge m left right t i j hn,
38
+ graphHoppingMatrix_nonedge m left right s i j hn,sub_self,norm_zero]
39
+ exact hε
40
+
41
+ theorem planarHoppingMatrix_calibrated_error (m : ℕ)
42
+ (left right : Edge → Fin (m+1)) (u : Fin (m+1) → PlanarPosition)
43
+ (hloop : ∀ e, left e ≠ right e)
44
+ (hsimple : ∀ e f, e ≠ f →
45
+ ¬(left e=left f ∧ right e=right f) ∧ ¬(left e=right f ∧ right e=left f))
46
+ {scale D L ε : ℝ} (hscale : 0 ≤ scale) (hD : 2 ≤ D) (hε : 0 ≤ ε)
47
+ (hL : ∀ i j, ‖u i-u j‖ ≤ L)
48
+ (hsep : ∀ i j, i ≠ j →
49
+ (∀ e, ¬(i=left e ∧ j=right e) ∧ ¬(i=right e ∧ j=left e)) → D ≤ ‖u i-u j‖)
50
+ (target : Edge → ℝ)
51
+ (hres : ∀ e, |scale*planarHopping ‖u (left e)-u (right e)‖-target e| ≤ ε)
52
+ (i j : Fin (m+1)) :
53
+ ‖((scale*planarHoppingMatrix u i j:ℝ):ℂ)-
54
+ graphHoppingMatrix m left right (fun e => (-(target e):ℝ)) i j‖ ≤
55
+ scale*planarHoppingUpperConstant*(L+1)*Real.exp (-D)+ε := by
56
+ let actual : Edge → ℂ := fun e => (-(scale*planarHopping ‖u (left e)-u (right e)‖):ℝ)
57
+ have hc := graphHoppingMatrix_stability m left right hloop hsimple actual
58
+ (fun e => (-(target e):ℝ)) hε (fun e => ?_) i j
59
+ · exact (norm_sub_le_norm_sub_add_norm_sub _ (graphHoppingMatrix m left right actual i j) _).trans
60
+ (add_le_add (planarHoppingMatrix_graph_error m left right u hloop hsimple
61
+ hscale hD hL hsep i j) hc)
62
+ · simpa only [actual,← Complex.ofReal_sub,Complex.norm_real,Real.norm_eq_abs,
63
+ neg_sub_neg,abs_sub_comm] using hres e
64
+
65
+ end ContinuumCoulomb.HubbardGlobal
66
+
67
+ end
68
+
69
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationCoefficientError.lean ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationSquareError
2
+
3
+ namespace OAI
4
+
5
+ /-! A numerical calibration residual controls the actual superexchange
6
+ coefficient directly. No inverse-function or derivative lower bound is used. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb
10
+
11
+ theorem calibrated_coefficient_error {a K gap τ ε : ℝ}
12
+ (hK : 0 ≤ K) (hgap : 0 < gap) (hτ : 0 ≤ τ)
13
+ (hres : |a - τ * Real.sqrt (K * gap)| ≤ ε) :
14
+ |a ^ 2 / gap - τ ^ 2 * K| ≤
15
+ ε * (2 * τ * Real.sqrt (K * gap) + ε) / gap := by
16
+ let b := τ * Real.sqrt (K * gap)
17
+ have hb : 0 ≤ b := mul_nonneg hτ (Real.sqrt_nonneg _)
18
+ have he : 0 ≤ ε := (abs_nonneg _).trans hres
19
+ have hb2 : b ^ 2 = τ ^ 2 * K * gap := by
20
+ dsimp only [b]
21
+ rw [mul_pow, Real.sq_sqrt (mul_nonneg hK hgap.le)]
22
+ ring
23
+ have ha : |a| ≤ b + ε := by
24
+ calc
25
+ _ = |(a - b) + b| := by congr 1; ring
26
+ _ ≤ |a - b| + |b| := abs_add_le _ _
27
+ _ ≤ ε + b := add_le_add hres (le_of_eq (abs_of_nonneg hb))
28
+ _ = _ := by ring
29
+ have hsum : |a + b| ≤ 2 * b + ε :=
30
+ (abs_add_le _ _).trans (by rw [abs_of_nonneg hb]; linarith)
31
+ have hsq : |a ^ 2 - b ^ 2| ≤ ε * (2 * b + ε) := by
32
+ rw [show a ^ 2 - b ^ 2 = (a - b) * (a + b) by ring, abs_mul]
33
+ exact mul_le_mul hres hsum (abs_nonneg _) he
34
+ have hid : a ^ 2 / gap - τ ^ 2 * K = (a ^ 2 - b ^ 2) / gap := by
35
+ rw [hb2]
36
+ field_simp [hgap.ne']
37
+ rw [hid, abs_div, abs_of_pos hgap]
38
+ simpa only [b, mul_assoc] using div_le_div_of_nonneg_right hsq hgap.le
39
+
40
+ end ContinuumCoulomb
41
+
42
+ end
43
+
44
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationCoulombBrackets.lean ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationEndpointSigns
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CoulombTargetRange
3
+
4
+ namespace OAI
5
+
6
+ /-! Explicit rational search intervals for the actual Coulomb-calibrated
7
+ hopping target. The fixed exponent simultaneously enforces the separated
8
+ two-site denominator and both endpoint signs. -/
9
+
10
+ noncomputable section
11
+ namespace ContinuumCoulomb.CalibrationRationalBracket
12
+
13
+ theorem exists_coulomb_brackets {freq : ℝ} (hfreq : 0 < freq)
14
+ (ε : ℚ) (hε : 0 < ε) (hε1 : ε < 1) (A B : ℕ) (kmin : ℝ) :
15
+ ∃ (c : ℚ) (k : ℕ), 0 < c ∧ 0 < k ∧ kmin ≤ (k : ℝ) ∧
16
+ ∀ N : ℕ, 2 ≤ N →
17
+ let D := (k : ℝ) * Real.log (N : ℝ)
18
+ let p := endpoints ε (RationalLogScale.value c k N)
19
+ (1 - (ε : ℝ)) * D ≤ p.1 ∧ p.2 ≤ (1 + (ε : ℝ)) * D ∧
20
+ 5 ≤ (1 - (ε : ℝ)) * D ∧
21
+ (∀ r : ℝ, (p.1 : ℝ) ≤ r → localizedGramConstant freq ≤
22
+ localizedCoulombProfile freq 0 - localizedCoulombProfile freq r) ∧
23
+ (∀ K : ℚ, ((N : ℝ) ^ A)⁻¹ ≤ K → (K : ℝ) ≤ (N : ℝ) ^ A →
24
+ 0 ≤ (N : ℝ) ^ k * planarHopping p.1 -
25
+ coulombHoppingTarget freq ((N : ℝ) ^ B)⁻¹ K p.1 ∧
26
+ (N : ℝ) ^ k * planarHopping p.2 -
27
+ coulombHoppingTarget freq ((N : ℝ) ^ B)⁻¹ K p.2 ≤ 0) := by
28
+ have hεR : (0 : ℝ) < ε := by exact_mod_cast hε
29
+ have hεR1 : (ε : ℝ) < 1 := by exact_mod_cast hε1
30
+ obtain ⟨L, _, hrange⟩ := exists_coulomb_target_polynomial_bounds hfreq A B
31
+ obtain ⟨k₀, _, hspacing⟩ := exists_localizedGram_spacing hfreq 1
32
+ obtain ⟨c, k, hc, hk, hkmin, hbracket⟩ := exists_rational_hopping_brackets
33
+ ε hε hε1 (B + A + L) (max kmin ((k₀ : ℝ) / (1 - (ε : ℝ))))
34
+ have hkmin' : kmin ≤ (k : ℝ) := (le_max_left _ _).trans hkmin
35
+ have hkspacing : (k₀ : ℝ) / (1 - (ε : ℝ)) ≤ k := (le_max_right _ _).trans hkmin
36
+ refine ⟨c, k, hc, hk, hkmin', fun N hN => ?_⟩
37
+ have hNR : (2 : ℝ) ≤ N := by exact_mod_cast hN
38
+ have hNp : (0 : ℝ) < N := by linarith
39
+ have hlogN : 0 ≤ Real.log (N : ℝ) := Real.log_nonneg (by linarith)
40
+ let D : ℝ := (k : ℝ) * Real.log (N : ℝ)
41
+ let p := endpoints ε (RationalLogScale.value c k N)
42
+ obtain ⟨ha0, ha1, hb0, hb1, haHop, hbHop⟩ := hbracket N hN
43
+ have hlength : (k₀ : ℝ) * Real.log (N : ℝ) ≤ (1 - (ε : ℝ)) * D := by
44
+ have hm := mul_le_mul_of_nonneg_right
45
+ ((div_le_iff₀ (sub_pos.mpr hεR1)).mp hkspacing) hlogN
46
+ nlinarith only [hm]
47
+ obtain ⟨hfive, hleak⟩ := hspacing N hNR
48
+ have hleak₂ : 2 * localLeakageBound freq ((k₀ : ℝ) * Real.log (N : ℝ)) ≤
49
+ localDualMass freq / 2 := by
50
+ have hm := mul_le_mul_of_nonneg_right hNR
51
+ (localLeakageBound_nonnegative freq ((k₀ : ℝ) * Real.log (N : ℝ)))
52
+ exact hm.trans (by simpa only [pow_one] using hleak)
53
+ have hsepA : (k₀ : ℝ) * Real.log (N : ℝ) ≤ (p.1 : ℝ) := hlength.trans ha0
54
+ have hD0 : 0 ≤ D := mul_nonneg (Nat.cast_nonneg _) hlogN
55
+ have hab : (p.1 : ℝ) ≤ p.2 := by
56
+ have horder : (1 - (ε : ℝ) / 4) * D ≤ (1 + (ε : ℝ) / 4) * D := by
57
+ nlinarith [mul_nonneg hεR.le hD0]
58
+ exact ha1.trans (horder.trans hb0)
59
+ change (1 - (ε : ℝ)) * D ≤ (p.1 : ℝ) ∧ _
60
+ refine ⟨ha0, hb1, hfive.trans hlength, ?_, ?_⟩
61
+ · intro r hr
62
+ exact localizedCoulombProfile_gap hfreq hfive hleak₂ (hsepA.trans hr)
63
+ · intro K hKlo hKhi
64
+ have hK : (0 : ℝ) ≤ K := (inv_nonneg.mpr (pow_nonneg hNp.le A)).trans hKlo
65
+ have hτ : 0 ≤ ((N : ℝ) ^ B)⁻¹ := inv_nonneg.mpr (pow_nonneg hNp.le B)
66
+ obtain ⟨htlo, hthi⟩ := hrange N hNR K hKlo hKhi
67
+ have htargetA := coulombHoppingTarget_bounds hfreq hfive hleak₂ hsepA hτ hK
68
+ have htargetB := coulombHoppingTarget_bounds hfreq hfive hleak₂ (hsepA.trans hab) hτ hK
69
+ exact ⟨sub_nonneg.mpr ((htargetA.2.trans hthi).trans haHop),
70
+ sub_nonpos.mpr (hbHop.trans (htlo.trans htargetB.1))⟩
71
+
72
+ end ContinuumCoulomb.CalibrationRationalBracket
73
+
74
+ end
75
+
76
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationEndpointSigns.lean ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CalibrationRationalBracket
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.PlanarScaleChoice
3
+
4
+ namespace OAI
5
+
6
+ /-! The rational endpoints retain the analytic polynomial hopping brackets.
7
+ This uses the proved exponential envelopes and does not require monotonicity
8
+ of the hopping function. -/
9
+
10
+ noncomputable section
11
+ namespace ContinuumCoulomb.CalibrationRationalBracket
12
+
13
+ theorem brackets_of_larger_tolerance {A k : ℕ} {ε η N : ℝ}
14
+ (hε : 0 ≤ ε) (hεη : ε ≤ η) (hη1 : η ≤ 1) (hN : 2 ≤ N)
15
+ (hd : 2 ≤ (1 - η) * ((k : ℝ) * Real.log N))
16
+ (hγ : 0 ≤ (k : ℝ) * ε - ((A : ℝ) + 1))
17
+ (hlo : (k : ℝ) + 3 ≤ planarHoppingLowerConstant *
18
+ (2 : ℝ) ^ ((k : ℝ) * ε - ((A : ℝ) + 1)))
19
+ (hhi : planarHoppingUpperConstant * (2 * (k : ℝ) + 1) ≤
20
+ (2 : ℝ) ^ ((k : ℝ) * ε - ((A : ℝ) + 1))) :
21
+ N ^ A ≤ N ^ k * planarHopping ((1 - η) * ((k : ℝ) * Real.log N)) ∧
22
+ N ^ k * planarHopping ((1 + η) * ((k : ℝ) * Real.log N)) ≤ (N ^ A)⁻¹ := by
23
+ have he : (k : ℝ) * ε - ((A : ℝ) + 1) ≤ (k : ℝ) * η - ((A : ℝ) + 1) :=
24
+ sub_le_sub_right (mul_le_mul_of_nonneg_left hεη (Nat.cast_nonneg _)) _
25
+ have hp := Real.rpow_le_rpow_of_exponent_le (by norm_num : (1 : ℝ) ≤ 2) he
26
+ have h := planar_polynomial_brackets (hε.trans hεη) hη1 hN hd (hγ.trans he)
27
+ (hlo.trans (mul_le_mul_of_nonneg_left hp planarHoppingLowerConstant_positive.le))
28
+ (hhi.trans hp)
29
+ have heq : Real.exp ((k : ℝ) * Real.log N) = N ^ k := by
30
+ rw [Real.exp_nat_mul, Real.exp_log (by linarith)]
31
+ simpa only [heq] using h
32
+
33
+ theorem exists_rational_hopping_brackets (ε : ℚ) (hε : 0 < ε) (hε1 : ε < 1)
34
+ (A : ℕ) (kmin : ℝ) :
35
+ ∃ (c : ℚ) (k : ℕ), 0 < c ∧ 0 < k ∧ kmin ≤ (k : ℝ) ∧
36
+ ∀ N : ℕ, 2 ≤ N →
37
+ let D := (k : ℝ) * Real.log (N : ℝ)
38
+ let p := endpoints ε (RationalLogScale.value c k N)
39
+ (1 - (ε : ℝ)) * D ≤ p.1 ∧ p.1 ≤ (1 - (ε : ℝ) / 4) * D ∧
40
+ (1 + (ε : ℝ) / 4) * D ≤ p.2 ∧ p.2 ≤ (1 + (ε : ℝ)) * D ∧
41
+ (N : ℝ) ^ A ≤ (N : ℝ) ^ k * planarHopping p.1 ∧
42
+ (N : ℝ) ^ k * planarHopping p.2 ≤ ((N : ℝ) ^ A)⁻¹ := by
43
+ have hεR : (0 : ℝ) < ε := by exact_mod_cast hε
44
+ have hεR1 : (ε : ℝ) < 1 := by exact_mod_cast hε1
45
+ have hlog : 0 < Real.log 2 := Real.log_pos (by norm_num)
46
+ obtain ⟨c, hcpos, hc⟩ := RationalLogScale.exists_logTwo_approximation
47
+ (show (0 : ℝ) < (ε : ℝ) / 16 by positivity)
48
+ (show (ε : ℝ) / 16 ≤ 1 by linarith)
49
+ have hc' : |(c : ℝ) - Real.log 2| ≤ (ε : ℝ) / 64 * Real.log 2 := by
50
+ convert hc using 1; ring
51
+ let B : ℝ := max kmin (max (128 / (ε : ℝ)) (2 / ((1 - (ε : ℝ)) * Real.log 2)))
52
+ obtain ⟨k, hkpos, hkB, hγ, _hd, hlo, hhi⟩ := exists_planar_scale_conditions_above
53
+ B A (show (0 : ℝ) < (ε : ℝ) / 4 by positivity)
54
+ (show (ε : ℝ) / 4 < 1 by linarith)
55
+ have hkmin : kmin ≤ (k : ℝ) := (le_max_left _ _).trans hkB
56
+ have hkcount : 128 ≤ (ε : ℝ) * (k : ℝ) := by
57
+ have hb : 128 / (ε : ℝ) ≤ (k : ℝ) :=
58
+ (le_max_left _ _).trans ((le_max_right _ _).trans hkB)
59
+ nlinarith [(div_le_iff₀ hεR).mp hb]
60
+ have hkfloor : 2 ≤ (1 - (ε : ℝ)) * ((k : ℝ) * Real.log 2) := by
61
+ have hb : 2 / ((1 - (ε : ℝ)) * Real.log 2) ≤ (k : ℝ) :=
62
+ (le_max_right _ _).trans ((le_max_right _ _).trans hkB)
63
+ have hm := (div_le_iff₀ (mul_pos (sub_pos.mpr hεR1) hlog)).mp hb
64
+ nlinarith
65
+ refine ⟨c, k, hcpos, hkpos, hkmin, fun N hN => ?_⟩
66
+ have hNR : (2 : ℝ) ≤ N := by exact_mod_cast hN
67
+ have hlogN : Real.log 2 ≤ Real.log (N : ℝ) := Real.log_le_log (by norm_num) hNR
68
+ let D : ℝ := (k : ℝ) * Real.log (N : ℝ)
69
+ let p := endpoints ε (RationalLogScale.value c k N)
70
+ have hD : 0 < D := mul_pos (by exact_mod_cast hkpos) (hlog.trans_le hlogN)
71
+ have hfloor : 2 ≤ (1 - (ε : ℝ)) * D := by
72
+ have hm := mul_le_mul_of_nonneg_left hlogN (Nat.cast_nonneg k : (0 : ℝ) ≤ k)
73
+ exact hkfloor.trans (mul_le_mul_of_nonneg_left hm (sub_pos.mpr hεR1).le)
74
+ obtain ⟨ha0, ha1, hb0, hb1⟩ := rational_endpoint_bounds ε c hε hε1.le hc' k N hN hkcount
75
+ have har0 : 1 - (ε : ℝ) ≤ (p.1 : ℝ) / D := (le_div_iff₀ hD).mpr ha0
76
+ have har1 : (p.1 : ℝ) / D ≤ 1 - (ε : ℝ) / 4 := (div_le_iff₀ hD).mpr ha1
77
+ have hbr0 : 1 + (ε : ℝ) / 4 ≤ (p.2 : ℝ) / D := (le_div_iff₀ hD).mpr hb0
78
+ have hbr1 : (p.2 : ℝ) / D ≤ 1 + (ε : ℝ) := (div_le_iff₀ hD).mpr hb1
79
+ let ηa : ℝ := 1 - (p.1 : ℝ) / D
80
+ let ηb : ℝ := (p.2 : ℝ) / D - 1
81
+ have hηa : (ε : ℝ) / 4 ≤ ηa ∧ ηa ≤ (ε : ℝ) := by dsimp only [ηa]; constructor <;> linarith
82
+ have hηb : (ε : ℝ) / 4 ≤ ηb ∧ ηb ≤ (ε : ℝ) := by dsimp only [ηb]; constructor <;> linarith
83
+ have haeq : (1 - ηa) * D = (p.1 : ℝ) := by
84
+ dsimp only [ηa]
85
+ field_simp [hD.ne']; ring
86
+ have hbeq : (1 + ηb) * D = (p.2 : ℝ) := by
87
+ dsimp only [ηb]
88
+ field_simp [hD.ne']; ring
89
+ have hshort := brackets_of_larger_tolerance (show (0 : ℝ) ≤ (ε : ℝ) / 4 by positivity)
90
+ hηa.1 (hηa.2.trans hεR1.le) hNR
91
+ (hfloor.trans (mul_le_mul_of_nonneg_right (by linarith : 1 - (ε : ℝ) ≤ 1 - ηa) hD.le))
92
+ hγ hlo hhi
93
+ have hlong := brackets_of_larger_tolerance (show (0 : ℝ) ≤ (ε : ℝ) / 4 by positivity)
94
+ hηb.1 (hηb.2.trans hεR1.le) hNR
95
+ (hfloor.trans (mul_le_mul_of_nonneg_right (by linarith : 1 - (ε : ℝ) ≤ 1 - ηb) hD.le))
96
+ hγ hlo hhi
97
+ change (1 - (ε : ℝ)) * D ≤ (p.1 : ℝ) ∧ _
98
+ refine ⟨ha0, ha1, hb0, hb1, ?_, ?_⟩
99
+ · have hs : (N : ℝ) ^ A ≤ (N : ℝ) ^ k * planarHopping ((1 - ηa) * D) := hshort.1
100
+ rwa [haeq] at hs
101
+ · have hl : (N : ℝ) ^ k * planarHopping ((1 + ηb) * D) ≤ ((N : ℝ) ^ A)⁻¹ := hlong.2
102
+ rwa [hbeq] at hl
103
+
104
+ end ContinuumCoulomb.CalibrationRationalBracket
105
+
106
+ end
107
+
108
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationGraphBudget.lean ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.GraphCoefficientStability
2
+
3
+ namespace OAI
4
+
5
+ /-! A uniform coefficient budget for the actual calibrated Hubbard graph.
6
+ The residual is measured against the analytic hopping target, while the
7
+ conclusion concerns the finite-spin variational bottom. -/
8
+
9
+ noncomputable section
10
+ namespace ContinuumCoulomb
11
+ open scoped BigOperators
12
+
13
+ theorem calibrated_coefficient_uniform_error {a K gap τ ε g N U : ℝ}
14
+ (hK : 0 ≤ K) (hKN : K ≤ N) (hg : 0 < g) (hgap : g ≤ gap) (hU : gap ≤ U)
15
+ (hτ : 0 ≤ τ) (hτ1 : τ ≤ 1)
16
+ (hres : |a - τ * Real.sqrt (K * gap)| ≤ ε) :
17
+ |a ^ 2 / gap - τ ^ 2 * K| ≤ ε * (2 * Real.sqrt (N * U) + ε) / g := by
18
+ have hgapp : 0 < gap := hg.trans_le hgap
19
+ have hε : 0 ≤ ε := (abs_nonneg _).trans hres
20
+ have hN : 0 ≤ N := hK.trans hKN
21
+ have hroot : Real.sqrt (K * gap) ≤ Real.sqrt (N * U) :=
22
+ Real.sqrt_le_sqrt (mul_le_mul hKN hU hgapp.le hN)
23
+ have htarget : τ * Real.sqrt (K * gap) ≤ Real.sqrt (N * U) :=
24
+ (mul_le_mul_of_nonneg_right hτ1 (Real.sqrt_nonneg _)).trans (by simpa using hroot)
25
+ have hnum : ε * (2 * τ * Real.sqrt (K * gap) + ε) ≤
26
+ ε * (2 * Real.sqrt (N * U) + ε) := by
27
+ apply mul_le_mul_of_nonneg_left _ hε
28
+ linarith
29
+ exact (calibrated_coefficient_error hK hgapp hτ hres).trans
30
+ ((div_le_div_of_nonneg_right hnum hgapp.le).trans
31
+ (div_le_div_of_nonneg_left (by positivity) hg hgap))
32
+
33
+ namespace HubbardGlobal
34
+ variable {Edge : Type*} [Fintype Edge]
35
+
36
+ theorem calibrated_graphSourceBottom_uniform_error
37
+ (m : ℕ) (left right : Edge → Fin (m + 1))
38
+ (t K gap : Edge → ℝ) {τ ε g N U : ℝ}
39
+ (hK : ∀ e, 0 ≤ K e) (hKN : ∀ e, K e ≤ N)
40
+ (hg : 0 < g) (hgap : ∀ e, g ≤ gap e) (hU : ∀ e, gap e ≤ U)
41
+ (hτ : 0 ≤ τ) (hτ1 : τ ≤ 1)
42
+ (hres : ∀ e, |t e - τ * Real.sqrt (K e * gap e)| ≤ ε) :
43
+ |graphSourceBottom m left right (fun e => t e ^ 2 / gap e) -
44
+ graphSourceBottom m left right (fun e => τ ^ 2 * K e)| ≤
45
+ 4 * Fintype.card Edge * (ε * (2 * Real.sqrt (N * U) + ε) / g) := by
46
+ apply (graphSourceBottom_stability m left right _ _).trans
47
+ calc
48
+ 4 * ∑ e, |t e ^ 2 / gap e - τ ^ 2 * K e| ≤
49
+ 4 * ∑ _e : Edge, ε * (2 * Real.sqrt (N * U) + ε) / g := by
50
+ apply mul_le_mul_of_nonneg_left _ (by norm_num)
51
+ exact Finset.sum_le_sum (fun e _ => calibrated_coefficient_uniform_error
52
+ (hK e) (hKN e) hg (hgap e) (hU e) hτ hτ1 (hres e))
53
+ _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]; ring
54
+
55
+ end HubbardGlobal
56
+ end ContinuumCoulomb
57
+
58
+ end
59
+
60
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationMesh.lean ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.PhysicalNuclearProgram
2
+
3
+ namespace OAI
4
+
5
+ /-! Exact compatibility between polynomial hopping amplification and the
6
+ equal masses of the unit-nucleus Gauss mesh. -/
7
+
8
+ namespace ContinuumCoulomb.CalibrationMesh
9
+
10
+ def base (n : ℕ) : ℕ := n^30
11
+ def radius (n k : ℕ) : ℕ := n^k
12
+ def mesh (n k : ℕ) : ℕ := n^(10*k)
13
+ def width (n k : ℕ) : ℕ := n^(5*k)
14
+ def horizontal (n k : ℕ) : ℕ := width n k ^ 10
15
+ def prefactor (rho : ℕ) : ℚ := 8/(rho:ℚ)
16
+ def amplification (rho n k : ℕ) : ℚ := prefactor rho * (base n:ℚ)^k
17
+
18
+ theorem prefactor_positive {rho : ℕ} (hrho : 0 < rho) : 0 < prefactor rho := by
19
+ unfold prefactor
20
+ positivity
21
+
22
+ theorem base_ge_two {n : ℕ} (hn : 2 ≤ n) : 2 ≤ base n := by
23
+ exact (by norm_num : 2 ≤ 2^30).trans (Nat.pow_le_pow_left hn 30)
24
+
25
+ theorem mesh_positive {n : ℕ} (hn : 0 < n) (k : ℕ) : 0 < mesh n k := pow_pos hn _
26
+
27
+ theorem base_power_eq_mesh_cube (n k : ℕ) : base n ^ k = mesh n k ^ 3 := by
28
+ simp only [base,mesh,← pow_mul]
29
+ congr 1
30
+ omega
31
+
32
+ theorem amplification_eq_mesh (rho n k : ℕ) :
33
+ amplification rho n k = 8*(mesh n k:ℚ)^3/(rho:ℚ) := by
34
+ have he : (base n:ℚ)^k = (mesh n k:ℚ)^3 := by
35
+ exact_mod_cast base_power_eq_mesh_cube n k
36
+ rw [amplification,he,prefactor]
37
+ ring
38
+
39
+ theorem physical_factor_eq (rho n k : ℕ) :
40
+ PhysicalNuclearProgram.factor rho (mesh n k) = (amplification rho n k)⁻¹ := by
41
+ rw [amplification_eq_mesh,PhysicalNuclearProgram.factor]
42
+ exact (inv_div _ _).symm
43
+
44
+ theorem amplification_positive {rho n : ℕ} (hrho : 0 < rho) (hn : 0 < n) (k : ℕ) :
45
+ 0 < amplification rho n k := by
46
+ rw [amplification_eq_mesh]
47
+ have hm := mesh_positive hn k
48
+ positivity
49
+
50
+ theorem mesh_eq_radius (n k : ℕ) : mesh n k = radius n k ^ 10 := by
51
+ simp only [mesh,radius,← pow_mul]
52
+ congr 1
53
+ omega
54
+
55
+ theorem width_eq_radius (n k : ℕ) : width n k = radius n k ^ 5 := by
56
+ simp only [width,radius,← pow_mul]
57
+ congr 1
58
+ omega
59
+
60
+ end ContinuumCoulomb.CalibrationMesh
61
+
62
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationRationalBracket.lean ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalLogScale
2
+
3
+ namespace OAI
4
+
5
+ /-! Rational endpoints lie inside the permitted contact interval and outside
6
+ the smaller interval used for the analytic sign estimates. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb.CalibrationRationalBracket
10
+
11
+ def endpoints (ε q : ℚ) : ℚ × ℚ := ((1 - ε / 2) * q, (1 + ε / 2) * q)
12
+
13
+ theorem endpoint_bounds {ε D q : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (hD : 0 ≤ D)
14
+ (hqlo : (1 - ε / 16) * D ≤ q) (hqhi : q ≤ (1 + ε / 16) * D) :
15
+ (1 - ε) * D ≤ (1 - ε / 2) * q ∧
16
+ (1 - ε / 2) * q ≤ (1 - ε / 4) * D ∧
17
+ (1 + ε / 4) * D ≤ (1 + ε / 2) * q ∧
18
+ (1 + ε / 2) * q ≤ (1 + ε) * D := by
19
+ have hc0 : 0 ≤ 1 - ε / 2 := by linarith
20
+ have hc1 : 0 ≤ 1 + ε / 2 := by linarith
21
+ have hsq : ε ^ 2 ≤ ε := by nlinarith
22
+ have ha0 : 1 - ε ≤ (1 - ε / 2) * (1 - ε / 16) := by nlinarith [sq_nonneg ε]
23
+ have ha1 : (1 - ε / 2) * (1 + ε / 16) ≤ 1 - ε / 4 := by nlinarith [sq_nonneg ε]
24
+ have hb0 : 1 + ε / 4 ≤ (1 + ε / 2) * (1 - ε / 16) := by nlinarith
25
+ have hb1 : (1 + ε / 2) * (1 + ε / 16) ≤ 1 + ε := by nlinarith
26
+ refine ⟨?_, ?_, ?_, ?_⟩
27
+ · exact (mul_le_mul_of_nonneg_right ha0 hD).trans
28
+ (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hqlo hc0)
29
+ · exact (mul_le_mul_of_nonneg_left hqhi hc0).trans
30
+ (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_right ha1 hD)
31
+ · exact (mul_le_mul_of_nonneg_right hb0 hD).trans
32
+ (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hqlo hc1)
33
+ · exact (mul_le_mul_of_nonneg_left hqhi hc1).trans
34
+ (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_right hb1 hD)
35
+
36
+ theorem rational_endpoint_bounds (ε c : ℚ) (hε : 0 < ε) (hε1 : ε ≤ 1)
37
+ (hc : |(c : ℝ) - Real.log 2| ≤ (ε : ℝ) / 64 * Real.log 2)
38
+ (k N : ℕ) (hN : 2 ≤ N) (hk : 128 ≤ (ε : ℝ) * (k : ℝ)) :
39
+ let D := (k : ℝ) * Real.log (N : ℝ)
40
+ let p := endpoints ε (RationalLogScale.value c k N)
41
+ (1 - (ε : ℝ)) * D ≤ p.1 ∧ p.1 ≤ (1 - (ε : ℝ) / 4) * D ∧
42
+ (1 + (ε : ℝ) / 4) * D ≤ p.2 ∧ p.2 ≤ (1 + (ε : ℝ)) * D := by
43
+ have hεR : (0 : ℝ) < ε := by exact_mod_cast hε
44
+ have hεR1 : (ε : ℝ) ≤ 1 := by exact_mod_cast hε1
45
+ have hc' : |(c : ℝ) - Real.log 2| ≤ ((ε : ℝ) / 16) / 4 * Real.log 2 := by
46
+ convert hc using 1; ring
47
+ have hk' : 8 ≤ ((ε : ℝ) / 16) * (k : ℝ) := by nlinarith
48
+ obtain ⟨hlo, hhi⟩ := RationalLogScale.relative_bounds c
49
+ (show 0 < (ε : ℝ) / 16 by positivity) (show (ε : ℝ) / 16 ≤ 1 by linarith)
50
+ hc' k N hN hk'
51
+ have hD : 0 ≤ (k : ℝ) * Real.log (N : ℝ) :=
52
+ mul_nonneg (Nat.cast_nonneg _) (Real.log_nonneg (by exact_mod_cast (show 1 ≤ N by omega)))
53
+ simpa only [endpoints, Rat.cast_mul, Rat.cast_sub, Rat.cast_add, Rat.cast_div,
54
+ Rat.cast_one, Rat.cast_ofNat] using endpoint_bounds hεR hεR1 hD hlo hhi
55
+
56
+ end ContinuumCoulomb.CalibrationRationalBracket
57
+
58
+ end
59
+
60
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CalibrationSquareError.lean ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.RationalSquareRoot
2
+
3
+ namespace OAI
4
+
5
+ /-! Scalar error propagation for the square root appearing in the
6
+ calibrated hopping target. Negative numerical gaps are clipped at zero. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb
10
+
11
+ theorem clipped_difference_error {u v u' v' ε : ℝ} (hgap : 0 ≤ u - v)
12
+ (hu : |u' - u| ≤ ε) (hv : |v' - v| ≤ ε) :
13
+ |max 0 (u' - v') - (u - v)| ≤ 2 * ε := by
14
+ have hm := abs_max_sub_max_le_abs (u' - v') (u - v) (0 : ℝ)
15
+ rw [max_eq_left hgap] at hm
16
+ rw [max_comm 0 (u' - v')]
17
+ apply hm.trans
18
+ have he : (u' - v') - (u - v) = (u' - u) - (v' - v) := by ring
19
+ rw [he]
20
+ exact (abs_sub _ _).trans ((add_le_add hu hv).trans_eq (by ring))
21
+
22
+ theorem clipped_sqrt_difference_error {u v u' v' K ε : ℝ}
23
+ (hK : 0 ≤ K) (hgap : 0 ≤ u - v)
24
+ (hu : |u' - u| ≤ ε) (hv : |v' - v| ≤ ε) :
25
+ |Real.sqrt (K * max 0 (u' - v')) - Real.sqrt (K * (u - v))| ≤
26
+ Real.sqrt (2 * K * ε) := by
27
+ have hs := RationalSquareRoot.sqrt_perturbation
28
+ (mul_nonneg hK (le_max_left 0 (u' - v'))) (mul_nonneg hK hgap)
29
+ have he : |K * max 0 (u' - v') - K * (u - v)| ≤ 2 * K * ε := by
30
+ rw [← mul_sub, abs_mul, abs_of_nonneg hK]
31
+ exact (mul_le_mul_of_nonneg_left (clipped_difference_error hgap hu hv) hK).trans_eq (by ring)
32
+ exact hs.trans (Real.sqrt_le_sqrt he)
33
+
34
+ theorem calibrated_residual_error {scale τ K T T' u v u' v' r' εT εC εR : ℝ}
35
+ (hscale : 0 ≤ scale) (hτ : 0 ≤ τ) (hK : 0 ≤ K) (hgap : 0 ≤ u - v)
36
+ (hT : |T' - T| ≤ εT) (hu : |u' - u| ≤ εC) (hv : |v' - v| ≤ εC)
37
+ (hr : |r' - Real.sqrt (K * max 0 (u' - v'))| ≤ εR) :
38
+ |(scale * T' - τ * r') - (scale * T - τ * Real.sqrt (K * (u - v)))| ≤
39
+ scale * εT + τ * (εR + Real.sqrt (2 * K * εC)) := by
40
+ have hs := clipped_sqrt_difference_error hK hgap hu hv
41
+ have ht := (abs_sub_le r' (Real.sqrt (K * max 0 (u' - v')))
42
+ (Real.sqrt (K * (u - v)))).trans (add_le_add hr hs)
43
+ have he : (scale * T' - τ * r') - (scale * T - τ * Real.sqrt (K * (u - v))) =
44
+ scale * (T' - T) - τ * (r' - Real.sqrt (K * (u - v))) := by ring
45
+ rw [he]
46
+ apply (abs_sub _ _).trans
47
+ rw [abs_mul, abs_mul, abs_of_nonneg hscale, abs_of_nonneg hτ]
48
+ exact add_le_add (mul_le_mul_of_nonneg_left hT hscale) (mul_le_mul_of_nonneg_left ht hτ)
49
+
50
+ end ContinuumCoulomb
51
+
52
+ end
53
+
54
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedCoulombKernel.lean ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.LocalizedCoulomb
2
+
3
+ namespace OAI
4
+
5
+ /-! A bounded Lipschitz kernel for literal Coulomb quadrature. The original
6
+ singular potential differs only inside the cap radius; the next theorem
7
+ controls that error by the actual Coulomb mass of the small ball. -/
8
+
9
+ noncomputable section
10
+ open MeasureTheory
11
+ namespace ContinuumCoulomb
12
+
13
+ def cappedCoulombKernel (ε : ℝ) (x : Position) : ℝ := (max ε ‖x‖)⁻¹
14
+
15
+ theorem cappedCoulombKernel_nonnegative {ε : ℝ} (hε : 0 < ε) (x : Position) :
16
+ 0 ≤ cappedCoulombKernel ε x := by
17
+ unfold cappedCoulombKernel
18
+ exact inv_nonneg.mpr (hε.le.trans (le_max_left _ _))
19
+
20
+ theorem cappedCoulombKernel_le {ε : ℝ} (hε : 0 < ε) (x : Position) :
21
+ cappedCoulombKernel ε x ≤ ε⁻¹ :=
22
+ inv_anti₀ hε (le_max_left _ _)
23
+
24
+ theorem cappedCoulombKernel_continuous {ε : ℝ} (hε : 0 < ε) :
25
+ Continuous (cappedCoulombKernel ε) := by
26
+ apply (continuous_const.max continuous_norm).inv₀
27
+ intro x
28
+ exact (hε.trans_le (le_max_left _ _)).ne'
29
+
30
+ theorem cappedCoulombKernel_norm_sub {ε : ℝ} (hε : 0 < ε) (x y : Position) :
31
+ |cappedCoulombKernel ε x - cappedCoulombKernel ε y| ≤ ε⁻¹ ^ 2 * ‖x - y‖ := by
32
+ let a := max ε ‖x‖
33
+ let b := max ε ‖y‖
34
+ have ha : 0 < a := hε.trans_le (le_max_left _ _)
35
+ have hb : 0 < b := hε.trans_le (le_max_left _ _)
36
+ have hia : a⁻¹ ≤ ε⁻¹ := inv_anti₀ hε (le_max_left _ _)
37
+ have hib : b⁻¹ ≤ ε⁻¹ := inv_anti₀ hε (le_max_left _ _)
38
+ have hdiff : |a - b| ≤ ‖x - y‖ := by
39
+ have hm := abs_max_sub_max_le_abs ‖x‖ ‖y‖ ε
40
+ rw [max_comm ‖x‖ ε, max_comm ‖y‖ ε] at hm
41
+ exact hm.trans (abs_norm_sub_norm_le x y)
42
+ have he : cappedCoulombKernel ε x - cappedCoulombKernel ε y =
43
+ (b - a) * a⁻¹ * b⁻¹ := by
44
+ change a⁻¹ - b⁻¹ = _
45
+ field_simp [ha.ne', hb.ne']
46
+ rw [he, abs_mul, abs_mul, abs_of_pos (inv_pos.mpr ha),
47
+ abs_of_pos (inv_pos.mpr hb), abs_sub_comm b a]
48
+ calc
49
+ _ ≤ ‖x - y‖ * ε⁻¹ * ε⁻¹ := by gcongr
50
+ _ = _ := by ring
51
+
52
+ theorem cappedCoulombKernel_difference {ε : ℝ} (hε : 0 < ε)
53
+ (x : Position) (hx : x ≠ 0) :
54
+ |NeutralAtom.coulombKernel x - cappedCoulombKernel ε x| ≤
55
+ (Metric.ball (0 : Position) ε).indicator NeutralAtom.coulombKernel x := by
56
+ have hn : 0 < ‖x‖ := norm_pos_iff.mpr hx
57
+ by_cases he : ‖x‖ < ε
58
+ · rw [Set.indicator_of_mem (by simpa only [Metric.mem_ball, dist_zero_right] using he)]
59
+ have hc : cappedCoulombKernel ε x = ε⁻¹ := by
60
+ unfold cappedCoulombKernel
61
+ rw [max_eq_left he.le]
62
+ rw [NeutralAtom.coulombKernel, hc, abs_of_nonneg (sub_nonneg.mpr (inv_anti₀ hn he.le))]
63
+ have hi := inv_nonneg.mpr hε.le
64
+ linarith
65
+ · rw [Set.indicator_of_notMem (by simpa only [Metric.mem_ball, dist_zero_right] using he)]
66
+ simp only [NeutralAtom.coulombKernel, cappedCoulombKernel, max_eq_right (le_of_not_gt he),
67
+ sub_self, abs_zero, le_refl]
68
+
69
+ def cappedCoulombPotential (ε : ℝ) (ρ : Position → ℝ) (x : Position) : ℝ :=
70
+ ∫ y, cappedCoulombKernel ε (x - y) * ρ y
71
+
72
+ theorem cappedCoulombPotential_integrable {ε : ℝ} (hε : 0 < ε)
73
+ {ρ : Position → ℝ} (hρ : Integrable ρ) (x : Position) :
74
+ Integrable (fun y => cappedCoulombKernel ε (x - y) * ρ y) := by
75
+ apply hρ.bdd_mul (c := ε⁻¹)
76
+ ((cappedCoulombKernel_continuous hε).comp (continuous_const.sub continuous_id)).aestronglyMeasurable
77
+ exact Filter.Eventually.of_forall (fun y => by
78
+ change ‖cappedCoulombKernel ε (x - y)‖ ≤ ε⁻¹
79
+ rw [Real.norm_of_nonneg (cappedCoulombKernel_nonnegative hε _)]
80
+ exact cappedCoulombKernel_le hε _)
81
+
82
+ theorem cappedCoulombPotential_nonnegative {ε : ℝ} (hε : 0 < ε)
83
+ {ρ : Position → ℝ} (hpos : ∀ x, 0 ≤ ρ x) (x : Position) :
84
+ 0 ≤ cappedCoulombPotential ε ρ x :=
85
+ integral_nonneg (fun y => mul_nonneg (cappedCoulombKernel_nonnegative hε _) (hpos y))
86
+
87
+ theorem cappedCoulombPotential_le {ε : ℝ} (hε : 0 < ε)
88
+ {ρ : Position → ℝ} (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x) (x : Position) :
89
+ cappedCoulombPotential ε ρ x ≤ ε⁻¹ * ∫ y, ρ y := by
90
+ have h := integral_mono (cappedCoulombPotential_integrable hε hρ x)
91
+ (hρ.const_mul ε⁻¹) (fun y =>
92
+ mul_le_mul_of_nonneg_right (cappedCoulombKernel_le hε _) (hpos y))
93
+ simpa only [cappedCoulombPotential, integral_const_mul] using h
94
+
95
+ theorem cappedCoulombPotential_norm_sub {ε : ℝ} (hε : 0 < ε)
96
+ {ρ : Position → ℝ} (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x) (x x' : Position) :
97
+ ‖cappedCoulombPotential ε ρ x - cappedCoulombPotential ε ρ x'‖ ≤
98
+ (ε⁻¹ ^ 2 * ∫ y, ρ y) * ‖x - x'‖ := by
99
+ unfold cappedCoulombPotential
100
+ rw [← integral_sub (cappedCoulombPotential_integrable hε hρ x)
101
+ (cappedCoulombPotential_integrable hε hρ x')]
102
+ have h := norm_integral_le_of_norm_le
103
+ (f := fun y => cappedCoulombKernel ε (x - y) * ρ y -
104
+ cappedCoulombKernel ε (x' - y) * ρ y)
105
+ (hρ.const_mul (ε⁻¹ ^ 2 * ‖x - x'‖))
106
+ (Filter.Eventually.of_forall (fun y => by
107
+ rw [← sub_mul, norm_mul, Real.norm_of_nonneg (hpos y), Real.norm_eq_abs]
108
+ apply mul_le_mul_of_nonneg_right _ (hpos y)
109
+ simpa only [sub_sub_sub_cancel_right] using
110
+ cappedCoulombKernel_norm_sub hε (x - y) (x' - y)))
111
+ rw [integral_const_mul] at h
112
+ convert h using 1
113
+ ring
114
+
115
+ theorem cappedCoulombPotential_continuous {ε : ℝ} (hε : 0 < ε)
116
+ {ρ : Position → ℝ} (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x) :
117
+ Continuous (cappedCoulombPotential ε ρ) := by
118
+ have hc : 0 ≤ ε⁻¹ ^ 2 * ∫ y, ρ y :=
119
+ mul_nonneg (sq_nonneg _) (integral_nonneg hpos)
120
+ exact (show LipschitzWith ⟨ε⁻¹ ^ 2 * ∫ y, ρ y, hc⟩ (cappedCoulombPotential ε ρ) from
121
+ lipschitzWith_iff_norm_sub_le.mpr (cappedCoulombPotential_norm_sub hε hρ hpos)).continuous
122
+
123
+ theorem cappedCoulombPotential_error {ε B : ℝ} (hε : 0 < ε)
124
+ {ρ : Position → ℝ} (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x)
125
+ (hbound : ∀ x, ρ x ≤ B) (x : Position) :
126
+ |NeutralAtom.potentialOf ρ x - cappedCoulombPotential ε ρ x| ≤
127
+ B * NeutralAtom.kernelBallMass ε := by
128
+ have hi := (NeutralAtom.bounded_density_convolution NeutralAtom.measurable_coulombKernel
129
+ NeutralAtom.coulombKernel_nonneg (NeutralAtom.coulombKernel_integrableOn_ball 1)
130
+ (fun _ => NeutralAtom.coulombKernel_le_one) hρ hpos hbound x).1
131
+ rw [NeutralAtom.potentialOf, cappedCoulombPotential,
132
+ ← integral_sub hi (cappedCoulombPotential_integrable hε hρ x)]
133
+ have hd := norm_integral_le_of_norm_le
134
+ (f := fun y => NeutralAtom.coulombKernel (x - y) * ρ y -
135
+ cappedCoulombKernel ε (x - y) * ρ y)
136
+ ((NeutralAtom.translated_kernel_indicator_integrable x ε).const_mul B)
137
+ (by
138
+ filter_upwards [volume.ae_ne x] with y hy
139
+ rw [← sub_mul, norm_mul, Real.norm_of_nonneg (hpos y), Real.norm_eq_abs]
140
+ have hc := cappedCoulombKernel_difference hε (x - y) (sub_ne_zero.mpr hy.symm)
141
+ have hs : (Metric.ball (0 : Position) ε).indicator NeutralAtom.coulombKernel (x - y) =
142
+ (Metric.ball x ε).indicator (fun z => NeutralAtom.coulombKernel (x - z)) y := by
143
+ rw [NeutralAtom.translated_kernel_indicator_eq]
144
+ rw [hs] at hc
145
+ have hp : 0 ≤ (Metric.ball x ε).indicator
146
+ (fun z => NeutralAtom.coulombKernel (x - z)) y :=
147
+ Set.indicator_nonneg (fun z _ => NeutralAtom.coulombKernel_nonneg (x - z)) y
148
+ calc
149
+ _ ≤ (Metric.ball x ε).indicator
150
+ (fun z => NeutralAtom.coulombKernel (x - z)) y * B :=
151
+ mul_le_mul hc (hbound y) (hpos y) hp
152
+ _ = _ := mul_comm _ _)
153
+ simpa only [Real.norm_eq_abs, integral_const_mul,
154
+ NeutralAtom.translated_kernel_indicator_integral] using hd
155
+
156
+ end ContinuumCoulomb
157
+
158
+ end
159
+
160
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedCoulombMass.lean ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedCoulombKernel
2
+
3
+ namespace OAI
4
+
5
+ /-! The exact three-dimensional near-pole mass makes the cap error
6
+ quadratic in its rational radius. -/
7
+
8
+ noncomputable section
9
+ open MeasureTheory
10
+ namespace ContinuumCoulomb
11
+
12
+ theorem coulomb_kernelBallMass {ε : ℝ} (hε : 0 ≤ ε) :
13
+ NeutralAtom.kernelBallMass ε = 2 * Real.pi * ε ^ 2 := by
14
+ unfold NeutralAtom.kernelBallMass
15
+ rw [← integral_indicator measurableSet_ball]
16
+ have he : (Metric.ball (0 : Position) ε).indicator NeutralAtom.coulombKernel =
17
+ (fun x : Position => (Set.Iio ε).indicator (fun r : ℝ => r⁻¹) ‖x‖) := by
18
+ funext x
19
+ by_cases hx : ‖x‖ < ε
20
+ · simp [NeutralAtom.coulombKernel, Metric.mem_ball, dist_zero_right, hx]
21
+ · simp [Metric.mem_ball, dist_zero_right, hx]
22
+ rw [he, integral_fun_norm_addHaar volume]
23
+ have hi : (∫ r in Set.Ioi (0 : ℝ), r ^ (Module.finrank ℝ Position - 1) •
24
+ (Set.Iio ε).indicator (fun t : ℝ => t⁻¹) r) = ε ^ 2 / 2 := by
25
+ simp only [finrank_euclideanSpace_fin, smul_eq_mul]
26
+ norm_num
27
+ have hm : (fun r : ℝ => r ^ 2 * (Set.Iio ε).indicator (fun t : ℝ => t⁻¹) r) =
28
+ (Set.Iio ε).indicator (fun r : ℝ => r) := by
29
+ funext r
30
+ by_cases hr : r < ε
31
+ · simp only [Set.indicator_apply, Set.mem_Iio, hr, ite_true]
32
+ by_cases hzero : r = 0
33
+ · simp [hzero]
34
+ · field_simp [hzero]
35
+ · simp [hr]
36
+ rw [hm, setIntegral_indicator measurableSet_Iio]
37
+ have hinter : Set.Ioi (0 : ℝ) ∩ Set.Iio ε = Set.Ioo 0 ε := by ext r; rfl
38
+ rw [hinter, ← integral_Ioc_eq_integral_Ioo,
39
+ ← intervalIntegral.integral_of_le hε, integral_id]
40
+ ring
41
+ rw [hi]
42
+ simp only [Measure.real, EuclideanSpace.volume_ball_fin_three, ENNReal.ofReal_one, one_pow,
43
+ one_mul, ENNReal.toReal_ofReal (by positivity : 0 ≤ Real.pi * 4 / 3), smul_eq_mul,
44
+ nsmul_eq_mul]
45
+ norm_num [Position, finrank_euclideanSpace_fin]
46
+ ring
47
+
48
+ theorem cappedCoulombPotential_error_explicit {ε B : ℝ} (hε : 0 < ε)
49
+ {ρ : Position → ℝ} (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x)
50
+ (hbound : ∀ x, ρ x ≤ B) (x : Position) :
51
+ |NeutralAtom.potentialOf ρ x - cappedCoulombPotential ε ρ x| ≤
52
+ 2 * Real.pi * B * ε ^ 2 := by
53
+ have h := cappedCoulombPotential_error hε hρ hpos hbound x
54
+ rw [coulomb_kernelBallMass hε.le] at h
55
+ convert h using 1
56
+ ring
57
+
58
+ end ContinuumCoulomb
59
+
60
+ end
61
+
62
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedCoulombTruncation.lean ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CappedCoulombKernel
2
+
3
+ namespace OAI
4
+
5
+ /-! Finite-box truncation of the bounded Coulomb integral. The bound is
6
+ uniform in the displacement and uses only the discarded density masses. -/
7
+
8
+ noncomputable section
9
+ open MeasureTheory
10
+ namespace ContinuumCoulomb
11
+
12
+ def cappedPairIntegrand (ε : ℝ) (shift : Position) (f g : Position → ℝ)
13
+ (p : Position × Position) : ℝ :=
14
+ f p.1 * g p.2 * cappedCoulombKernel ε (p.1 - p.2 - shift)
15
+
16
+ theorem cappedPairIntegrand_integrable {ε : ℝ} (hε : 0 < ε) (shift : Position)
17
+ {f g : Position → ℝ} (hf : Integrable f) (hg : Integrable g) :
18
+ Integrable (cappedPairIntegrand ε shift f g) := by
19
+ have hp : Integrable (fun p : Position × Position => f p.1 * g p.2) := by
20
+ simpa only [Measure.volume_eq_prod] using hf.mul_prod hg
21
+ unfold cappedPairIntegrand
22
+ apply hp.mul_bdd (c := ε⁻¹)
23
+ (((cappedCoulombKernel_continuous hε).comp
24
+ ((continuous_fst.sub continuous_snd).sub continuous_const)).aestronglyMeasurable)
25
+ exact Filter.Eventually.of_forall (fun p => by
26
+ change ‖cappedCoulombKernel ε (p.1 - p.2 - shift)‖ ≤ ε⁻¹
27
+ rw [Real.norm_of_nonneg (cappedCoulombKernel_nonnegative hε _)]
28
+ exact cappedCoulombKernel_le hε _)
29
+
30
+ theorem cappedPair_truncation_error {ε : ℝ} (hε : 0 < ε) (shift : Position)
31
+ {f g : Position → ℝ} (hf : Integrable f) (hg : Integrable g)
32
+ (hf0 : ∀ x, 0 ≤ f x) (hg0 : ∀ y, 0 ≤ g y)
33
+ {S T : Set Position} (hS : MeasurableSet S) (hT : MeasurableSet T) :
34
+ |(∫ p, cappedPairIntegrand ε shift f g p) -
35
+ ∫ p in S ×ˢ T, cappedPairIntegrand ε shift f g p| ≤
36
+ ε⁻¹ * ((∫ x in Sᶜ, f x) * (∫ y, g y) +
37
+ (∫ x, f x) * (∫ y in Tᶜ, g y)) := by
38
+ let F := cappedPairIntegrand ε shift f g
39
+ let M : Position × Position → ℝ := fun p => ε⁻¹ *
40
+ (Sᶜ.indicator f p.1 * g p.2 + f p.1 * Tᶜ.indicator g p.2)
41
+ have hFi : Integrable F := cappedPairIntegrand_integrable hε shift hf hg
42
+ have hSi := hf.indicator hS.compl
43
+ have hTi := hg.indicator hT.compl
44
+ have hfirst : Integrable (fun p : Position × Position => Sᶜ.indicator f p.1 * g p.2) := by
45
+ simpa only [Measure.volume_eq_prod] using hSi.mul_prod hg
46
+ have hsecond : Integrable (fun p : Position × Position => f p.1 * Tᶜ.indicator g p.2) := by
47
+ simpa only [Measure.volume_eq_prod] using hf.mul_prod hTi
48
+ have hMi : Integrable M := by
49
+ simpa only [M, Pi.add_apply] using (hfirst.add hsecond).const_mul ε⁻¹
50
+ have hpt (p : Position × Position) :
51
+ ‖F p - (S ×ˢ T).indicator F p‖ ≤ M p := by
52
+ have hF0 : 0 ≤ F p := mul_nonneg (mul_nonneg (hf0 _) (hg0 _))
53
+ (cappedCoulombKernel_nonnegative hε _)
54
+ have hFbound : F p ≤ ε⁻¹ * (f p.1 * g p.2) := by
55
+ unfold F cappedPairIntegrand
56
+ calc
57
+ _ ≤ f p.1 * g p.2 * ε⁻¹ := mul_le_mul_of_nonneg_left
58
+ (cappedCoulombKernel_le hε _) (mul_nonneg (hf0 _) (hg0 _))
59
+ _ = _ := by ring
60
+ have hM0 : 0 ≤ M p := mul_nonneg (inv_nonneg.mpr hε.le)
61
+ (add_nonneg
62
+ (mul_nonneg (Set.indicator_nonneg (fun x _ => hf0 x) _) (hg0 _))
63
+ (mul_nonneg (hf0 _) (Set.indicator_nonneg (fun y _ => hg0 y) _)))
64
+ by_cases hs : p.1 ∈ S <;> by_cases ht : p.2 ∈ T
65
+ · rw [Set.indicator_of_mem (show p ∈ S ×ˢ T from ⟨hs, ht⟩), sub_self, norm_zero]
66
+ exact hM0
67
+ · have hp : p ∉ S ×ˢ T := by simp [ht]
68
+ rw [Set.indicator_of_notMem hp, sub_zero, Real.norm_of_nonneg hF0]
69
+ simpa only [M, Set.indicator_of_notMem (show p.1 ∉ Sᶜ by simpa using hs),
70
+ Set.indicator_of_mem (show p.2 ∈ Tᶜ from ht), zero_mul, zero_add] using hFbound
71
+ · have hp : p ∉ S ×ˢ T := by simp [hs]
72
+ rw [Set.indicator_of_notMem hp, sub_zero, Real.norm_of_nonneg hF0]
73
+ simpa only [M, Set.indicator_of_mem (show p.1 ∈ Sᶜ from hs),
74
+ Set.indicator_of_notMem (show p.2 ∉ Tᶜ by simpa using ht), mul_zero, add_zero] using hFbound
75
+ · have hp : p ∉ S ×ˢ T := by simp [hs]
76
+ rw [Set.indicator_of_notMem hp, sub_zero, Real.norm_of_nonneg hF0]
77
+ dsimp only [M]
78
+ rw [Set.indicator_of_mem (show p.1 ∈ Sᶜ from hs),
79
+ Set.indicator_of_mem (show p.2 ∈ Tᶜ from ht)]
80
+ have hz := mul_nonneg (inv_nonneg.mpr hε.le) (mul_nonneg (hf0 p.1) (hg0 p.2))
81
+ linarith
82
+ rw [← integral_indicator (hS.prod hT), ← integral_sub hFi (hFi.indicator (hS.prod hT))]
83
+ have h := norm_integral_le_of_norm_le
84
+ (f := fun p => F p - (S ×ˢ T).indicator F p) hMi (Filter.Eventually.of_forall hpt)
85
+ rw [Real.norm_eq_abs] at h
86
+ apply h.trans_eq
87
+ simp only [M, integral_const_mul]
88
+ rw [integral_add hfirst hsecond, Measure.volume_eq_prod, integral_prod_mul, integral_prod_mul,
89
+ integral_indicator hS.compl, integral_indicator hT.compl]
90
+
91
+ end ContinuumCoulomb
92
+
93
+ end
94
+
95
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedRawModulus.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.RawDensityModulus
2
+
3
+ namespace OAI
4
+
5
+ /-! A polynomial modulus for the actual six-coordinate capped density
6
+ integrand. Relative displacement has no effect on this modulus. -/
7
+
8
+ noncomputable section
9
+ namespace ContinuumCoulomb
10
+
11
+ theorem bounded_product_sub {a b c d : ℝ}
12
+ (ha0 : 0 ≤ a) (ha1 : a ≤ 1) (hd0 : 0 ≤ d) (hd1 : d ≤ 1) :
13
+ |a * b - c * d| ≤ |a - c| + |b - d| := by
14
+ have he : a * b - c * d = a * (b - d) + (a - c) * d := by ring
15
+ rw [he]
16
+ apply (abs_add_le _ _).trans
17
+ rw [abs_mul, abs_mul, abs_of_nonneg ha0, abs_of_nonneg hd0]
18
+ have h1 := mul_le_of_le_one_left (abs_nonneg (b - d)) ha1
19
+ have h2 := mul_le_of_le_one_right (abs_nonneg (a - c)) hd1
20
+ linarith
21
+
22
+ theorem cappedRawPair_modulus {freq ε L : ℝ} (hf : 0 ≤ freq) (hε : 0 < ε)
23
+ (shift : Position) (x y x' y' : Position)
24
+ (hx : |(positionSplitCoordinates x).2| ≤ L)
25
+ (hy : |(positionSplitCoordinates y).2| ≤ L)
26
+ (hx' : |(positionSplitCoordinates x').2| ≤ L)
27
+ (hy' : |(positionSplitCoordinates y').2| ≤ L) :
28
+ |cappedPairIntegrand ε shift (localizedRawDensity freq) (localizedRawDensity freq) (x, y) -
29
+ cappedPairIntegrand ε shift (localizedRawDensity freq) (localizedRawDensity freq) (x', y')| ≤
30
+ ((64 + 2 * freq * L) * ε⁻¹ + ε⁻¹ ^ 2) * (‖x - x'‖ + ‖y - y'‖) := by
31
+ let a := localizedRawDensity freq x * localizedRawDensity freq y
32
+ let b := localizedRawDensity freq x' * localizedRawDensity freq y'
33
+ let k := cappedCoulombKernel ε (x - y - shift)
34
+ let k' := cappedCoulombKernel ε (x' - y' - shift)
35
+ have hb0 : 0 ≤ b := mul_nonneg (localizedRawDensity_nonnegative _ _) (localizedRawDensity_nonnegative _ _)
36
+ have hb1 : b ≤ 1 := (mul_le_mul (localizedRawDensity_le_one hf _)
37
+ (localizedRawDensity_le_one hf _) (localizedRawDensity_nonnegative _ _) zero_le_one).trans_eq (one_mul 1)
38
+ have hk0 : 0 ≤ k := cappedCoulombKernel_nonnegative hε _
39
+ have hk1 : k ≤ ε⁻¹ := cappedCoulombKernel_le hε _
40
+ have hab : |a - b| ≤ (64 + 2 * freq * L) * (‖x - x'‖ + ‖y - y'‖) := by
41
+ have h := bounded_product_sub (a := localizedRawDensity freq x)
42
+ (b := localizedRawDensity freq y) (c := localizedRawDensity freq x')
43
+ (d := localizedRawDensity freq y') (localizedRawDensity_nonnegative freq x)
44
+ (localizedRawDensity_le_one hf x) (localizedRawDensity_nonnegative freq y')
45
+ (localizedRawDensity_le_one hf y')
46
+ apply h.trans
47
+ have h1 := localizedRawDensity_box_modulus hf x x' hx hx'
48
+ have h2 := localizedRawDensity_box_modulus hf y y' hy hy'
49
+ linarith
50
+ have hkk : |k - k'| ≤ ε⁻¹ ^ 2 * (‖x - x'‖ + ‖y - y'‖) := by
51
+ have h := cappedCoulombKernel_norm_sub hε (x - y - shift) (x' - y' - shift)
52
+ have hn : ‖x - y - shift - (x' - y' - shift)‖ ≤ ‖x - x'‖ + ‖y - y'‖ := by
53
+ rw [show x - y - shift - (x' - y' - shift) = (x - x') - (y - y') by abel]
54
+ exact norm_sub_le _ _
55
+ exact h.trans (mul_le_mul_of_nonneg_left hn (sq_nonneg _))
56
+ have he : cappedPairIntegrand ε shift (localizedRawDensity freq) (localizedRawDensity freq) (x, y) -
57
+ cappedPairIntegrand ε shift (localizedRawDensity freq) (localizedRawDensity freq) (x', y') =
58
+ (a - b) * k + b * (k - k') := by
59
+ dsimp only [cappedPairIntegrand, a, b, k, k']
60
+ ring
61
+ rw [he]
62
+ apply (abs_add_le _ _).trans
63
+ rw [abs_mul, abs_mul, abs_of_nonneg hk0, abs_of_nonneg hb0]
64
+ have h1 := mul_le_mul hab hk1 hk0 (by
65
+ have hL : 0 ≤ L := (abs_nonneg _).trans hx
66
+ positivity)
67
+ have h2 := (mul_le_of_le_one_left (abs_nonneg (k - k')) hb1).trans hkk
68
+ nlinarith
69
+
70
+ end ContinuumCoulomb
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CappedWells.lean ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Reduction.Model
2
+
3
+ namespace OAI
4
+
5
+ /-!
6
+ # The explicit cap in the isolated-well construction
7
+
8
+ The quintic transition is the normalized integral of a positive multiple
9
+ of `s²(1-s)²`. Capping removes a whole neighbourhood of both nuclear poles.
10
+ The resulting pointwise bound is uniform in the secondary displacements,
11
+ as required before any energy tuning is carried out.
12
+ -/
13
+
14
+ noncomputable section
15
+ open scoped BigOperators
16
+ namespace ContinuumCoulomb
17
+
18
+ def wellTransition (s : ℝ) : ℝ := 6 * s ^ 5 - 15 * s ^ 4 + 10 * s ^ 3
19
+
20
+ theorem wellTransition_bounds {s : ℝ} (hs0 : 0 ≤ s) (hs1 : s ≤ 1) :
21
+ 0 ≤ wellTransition s ∧ wellTransition s ≤ 1 := by
22
+ have hleft : wellTransition s =
23
+ s ^ 3 * (1 + 3 * (1 - s) + 6 * (1 - s) ^ 2) := by
24
+ unfold wellTransition
25
+ ring
26
+ have hright : 1 - wellTransition s = (1 - s) ^ 3 * (1 + 3 * s + 6 * s ^ 2) := by
27
+ unfold wellTransition
28
+ ring
29
+ have h0 : 0 ≤ wellTransition s := by rw [hleft]; positivity
30
+ have h1 : 0 ≤ 1 - wellTransition s := by rw [hright]; positivity
31
+ exact ⟨h0, by linarith⟩
32
+
33
+ def wellCap (t : ℝ) : ℝ :=
34
+ if t ≤ 1 / 16 then 0 else if 1 / 8 ≤ t then 1 else wellTransition (16 * t - 1)
35
+
36
+ theorem wellCap_eq_zero {t : ℝ} (ht : t ≤ 1 / 16) : wellCap t = 0 := by
37
+ simp only [wellCap, ite_eq_left ht]
38
+
39
+ theorem wellCap_eq_one {t : ℝ} (ht : 1 / 8 ≤ t) : wellCap t = 1 := by
40
+ have hn : ¬ t ≤ 1 / 16 := by linarith
41
+ simp only [wellCap, ite_eq_right hn, ite_eq_left ht]
42
+
43
+ theorem wellCap_bounds (t : ℝ) : 0 ≤ wellCap t ∧ wellCap t ≤ 1 := by
44
+ unfold wellCap
45
+ split_ifs with h0 h1
46
+ · norm_num
47
+ · norm_num
48
+ · exact wellTransition_bounds (by linarith) (by linarith)
49
+
50
+ theorem wellCap_nonzero_radius {D r : ℝ} (hD : 0 < D)
51
+ (hcap : wellCap (r / D) ≠ 0) : D / 16 < r := by
52
+ have h : ¬ r / D ≤ 1 / 16 := fun hr => hcap (wellCap_eq_zero hr)
53
+ have hr := (lt_div_iff₀ hD).mp (lt_of_not_ge h)
54
+ linarith
55
+
56
+ def sitePotential (q q' : ℝ) (center displacement x : Position) : ℝ :=
57
+ q * Coulomb.coulombKernel (x - center) +
58
+ q' * Coulomb.coulombKernel (x - center - displacement)
59
+
60
+ def cappedSitePotential (D q q' : ℝ) (center displacement x : Position) : ℝ :=
61
+ wellCap (‖x - center‖ / D) * sitePotential q q' center displacement x
62
+
63
+ theorem sitePotential_nonneg {q q' : ℝ} (hq : 0 ≤ q) (hq' : 0 ≤ q')
64
+ (center displacement x : Position) : 0 ≤ sitePotential q q' center displacement x := by
65
+ unfold sitePotential Coulomb.coulombKernel
66
+ positivity
67
+
68
+ theorem cappedSitePotential_nonneg {D q q' : ℝ} (hq : 0 ≤ q) (hq' : 0 ≤ q')
69
+ (center displacement x : Position) :
70
+ 0 ≤ cappedSitePotential D q q' center displacement x :=
71
+ mul_nonneg (wellCap_bounds _).1 (sitePotential_nonneg hq hq' _ _ _)
72
+
73
+ theorem cappedSitePotential_zero_near_primary {D q q' : ℝ} (hD : 0 < D)
74
+ (center displacement x : Position) (hx : ‖x - center‖ ≤ D / 16) :
75
+ cappedSitePotential D q q' center displacement x = 0 := by
76
+ unfold cappedSitePotential
77
+ rw [wellCap_eq_zero ((div_le_iff₀ hD).mpr (by linarith)), zero_mul]
78
+
79
+ /-- The cap removes the secondary pole together with an explicit surrounding
80
+ ball; the cancellation is not merely a convention for the value at the pole. -/
81
+ theorem cappedSitePotential_zero_near_secondary {D q q' : ℝ}
82
+ (hD : 128 ≤ D) (center displacement x : Position)
83
+ (hdisp : ‖displacement‖ ≤ 4)
84
+ (hx : ‖x - center - displacement‖ ≤ D / 32) :
85
+ cappedSitePotential D q q' center displacement x = 0 := by
86
+ have hD0 : 0 < D := by linarith
87
+ have hnorm : ‖x - center‖ ≤ D / 16 := by
88
+ calc
89
+ ‖x - center‖ = ‖(x - center - displacement) + displacement‖ := by congr 1; abel
90
+ _ ≤ ‖x - center - displacement‖ + ‖displacement‖ := norm_add_le _ _
91
+ _ ≤ D / 16 := by linarith
92
+ unfold cappedSitePotential
93
+ rw [wellCap_eq_zero ((div_le_iff₀ hD0).mpr (by linarith)), zero_mul]
94
+
95
+ theorem cappedSitePotential_bound {D q q' : ℝ} (hD : 128 ≤ D)
96
+ (hq : 0 ≤ q) (hq' : 0 ≤ q') (center displacement x : Position)
97
+ (hdisp : ‖displacement‖ ≤ 4) :
98
+ cappedSitePotential D q q' center displacement x ≤ (16 * q + 32 * q') / D := by
99
+ have hD0 : 0 < D := by linarith
100
+ by_cases hc : wellCap (‖x - center‖ / D) = 0
101
+ · simp only [cappedSitePotential, hc, zero_mul]
102
+ positivity
103
+ · have hr := wellCap_nonzero_radius hD0 hc
104
+ have hs : D / 32 ≤ ‖x - center - displacement‖ := by
105
+ have ht : ‖x - center‖ ≤ ‖x - center - displacement‖ + ‖displacement‖ := by
106
+ calc
107
+ _ = ‖(x - center - displacement) + displacement‖ := by congr 1; abel
108
+ _ ≤ _ := norm_add_le _ _
109
+ linarith
110
+ have hprimary : Coulomb.coulombKernel (x - center) ≤ 16 / D := by
111
+ unfold Coulomb.coulombKernel
112
+ calc
113
+ _ ≤ (D / 16)⁻¹ := inv_anti₀ (by positivity) hr.le
114
+ _ = _ := by ring
115
+ have hsecondary : Coulomb.coulombKernel (x - center - displacement) ≤ 32 / D := by
116
+ unfold Coulomb.coulombKernel
117
+ calc
118
+ _ ≤ (D / 32)⁻¹ := inv_anti₀ (by positivity) hs
119
+ _ = _ := by ring
120
+ calc
121
+ cappedSitePotential D q q' center displacement x ≤ sitePotential q q' center displacement x :=
122
+ mul_le_of_le_one_left (sitePotential_nonneg hq hq' _ _ _) (wellCap_bounds _).2
123
+ _ ≤ q * (16 / D) + q' * (32 / D) :=
124
+ add_le_add (mul_le_mul_of_nonneg_left hprimary hq)
125
+ (mul_le_mul_of_nonneg_left hsecondary hq')
126
+ _ = _ := by ring
127
+
128
+ def backgroundPotential {m : ℕ} (D q q' : ℝ) (center displacement : Fin m → Position)
129
+ (site : Fin m) (x : Position) : ℝ :=
130
+ ∑ j, if j = site then 0 else cappedSitePotential D q q' (center j) (displacement j) x
131
+
132
+ theorem backgroundPotential_bounds {m : ℕ} {D q q' : ℝ} (hD : 128 ≤ D)
133
+ (hq : 0 ≤ q) (hq1 : q ≤ 1) (hq' : 0 ≤ q') (hq'1 : q' ≤ 1)
134
+ (center displacement : Fin m → Position) (hdisp : ∀ j, ‖displacement j‖ ≤ 4)
135
+ (site : Fin m) (x : Position) :
136
+ 0 ≤ backgroundPotential D q q' center displacement site x ∧
137
+ backgroundPotential D q q' center displacement site x ≤ 48 * m / D := by
138
+ have hD0 : 0 < D := by linarith
139
+ constructor
140
+ · exact Finset.sum_nonneg fun j _ => by
141
+ split_ifs
142
+ · exact le_rfl
143
+ · exact cappedSitePotential_nonneg hq hq' _ _ _
144
+ · calc
145
+ _ ≤ ∑ _j : Fin m, (48 / D : ℝ) := by
146
+ apply Finset.sum_le_sum
147
+ intro j _
148
+ split_ifs
149
+ · positivity
150
+ · apply (cappedSitePotential_bound hD hq hq' _ _ _ (hdisp j)).trans
151
+ apply (div_le_div_iff_of_pos_right hD0).mpr
152
+ linarith
153
+ _ = _ := by simp; ring
154
+
155
+ end ContinuumCoulomb
156
+
157
+ end
158
+
159
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredGaussEquiv.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.CenteredGaussProgram
2
+
3
+ namespace OAI
4
+
5
+ /-! The emitted centered label list is exactly the finite cell-by-eight-node
6
+ grid used by the Coulomb quadrature theorems. -/
7
+
8
+ noncomputable section
9
+ open scoped BigOperators
10
+ namespace ContinuumCoulomb.CenteredGaussLabels
11
+
12
+ def decode (i : GaussLatticeIndex) : TransformedGauss.Label :=
13
+ ((i.1 0,(i.1 1,i.1 2)),(decide (i.2 0=1),(decide (i.2 1=1),decide (i.2 2=1))))
14
+
15
+ private theorem bit_value (v : Fin 2) : (if decide (v=1) then (1:Fin 2) else 0) = v := by
16
+ fin_cases v <;> decide
17
+
18
+ @[simp] theorem index_decode (i : GaussLatticeIndex) :
19
+ RationalGaussNodes.index (decode i).1 (decode i).2 = i := by
20
+ apply Prod.ext
21
+ · funext a
22
+ fin_cases a <;> rfl
23
+ · funext a
24
+ fin_cases a <;> exact bit_value _
25
+
26
+ @[simp] theorem decode_index (l : TransformedGauss.Label) :
27
+ decode (RationalGaussNodes.index l.1 l.2) = l := by
28
+ apply TransformedGauss.index_injective
29
+ exact index_decode _
30
+
31
+ def indexEquiv : TransformedGauss.Label ≃ GaussLatticeIndex where
32
+ toFun l := RationalGaussNodes.index l.1 l.2
33
+ invFun := decode
34
+ left_inv := decode_index
35
+ right_inv := index_decode
36
+
37
+ abbrev Grid (r : Radii) :=
38
+ {k // k ∈ centeredGridIndices (radiiVector r)} × (Fin 3 → Fin 2)
39
+
40
+ def restrictedEquiv (r : Radii) : {l // l ∈ labels r} ≃ Grid r where
41
+ toFun l := (⟨(indexEquiv l.val).1,(mem_labels r l.val).mp l.property⟩,(indexEquiv l.val).2)
42
+ invFun kv := ⟨decode (kv.1.val,kv.2),(mem_labels r _).mpr (by
43
+ rw [index_decode]
44
+ exact kv.1.property)⟩
45
+ left_inv l := Subtype.ext (decode_index l.val)
46
+ right_inv kv := by
47
+ have he := index_decode (kv.1.val,kv.2)
48
+ have h1 : (indexEquiv (decode (kv.1.val,kv.2))).1 = kv.1.val :=
49
+ congrArg (fun p : GaussLatticeIndex => p.1) he
50
+ have h2 : (indexEquiv (decode (kv.1.val,kv.2))).2 = kv.2 :=
51
+ congrArg (fun p : GaussLatticeIndex => p.2) he
52
+ exact Prod.ext (Subtype.ext h1) h2
53
+
54
+ def enumerationEquiv (r : Radii) : Fin (labels r).length ≃ Grid r :=
55
+ (List.Nodup.getEquiv (labels r) (labels_nodup r)).trans (restrictedEquiv r)
56
+
57
+ @[simp] theorem enumeration_first (r : Radii) (a : Fin (labels r).length) :
58
+ (enumerationEquiv r a).1.val = (RationalGaussNodes.index ((labels r).get a).1 ((labels r).get a).2).1 := rfl
59
+
60
+ @[simp] theorem enumeration_second (r : Radii) (a : Fin (labels r).length) :
61
+ (enumerationEquiv r a).2 = (RationalGaussNodes.index ((labels r).get a).1 ((labels r).get a).2).2 := rfl
62
+
63
+ theorem sum_enumeration {A : Type*} [AddCommMonoid A] (r : Radii) (f : GaussLatticeIndex → A) :
64
+ (∑ a : Fin (labels r).length,
65
+ f (RationalGaussNodes.index ((labels r).get a).1 ((labels r).get a).2)) =
66
+ ∑ k : {k // k ∈ centeredGridIndices (radiiVector r)}, ∑ v : Fin 3 → Fin 2, f (k.val,v) := by
67
+ have he := (enumerationEquiv r).sum_comp (fun kv : Grid r => f (kv.1.val,kv.2))
68
+ simpa only [Fintype.sum_prod_type,enumeration_first,enumeration_second] using he
69
+
70
+ end ContinuumCoulomb.CenteredGaussLabels
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredGaussLabels.lean ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.TransformedGaussSeparation
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CenteredGrid
3
+
4
+ namespace OAI
5
+
6
+ /-! A concrete duplicate-free list of all eight Gauss labels in each cell
7
+ of the centered rectangular grid, with the exact polynomial count. -/
8
+
9
+ namespace ContinuumCoulomb.CenteredGaussLabels
10
+ open EulerRegisters (Registers)
11
+ open RationalGaussNodes (Signs)
12
+
13
+ abbrev Radii := ℕ×(ℕ×ℕ)
14
+
15
+ def integers (R : ℕ) : List ℤ :=
16
+ (List.range (2*R+1)).map (fun j : ℕ => (j:ℤ)-(R:ℤ))
17
+ def signs : List Signs :=
18
+ [false,true] ×ˢ ([false,true] ×ˢ [false,true])
19
+ def cells (r : Radii) : List Registers :=
20
+ integers r.1 ×ˢ (integers r.2.1 ×ˢ integers r.2.2)
21
+ def labels (r : Radii) : List (Registers×Signs) := cells r ×ˢ signs
22
+ def radiiVector (r : Radii) : Fin 3 → ℕ := ![r.1,r.2.1,r.2.2]
23
+
24
+ theorem mem_integers (R : ℕ) (j : ℤ) : j ∈ integers R ↔ -(R:ℤ) ≤ j ∧ j ≤ R := by
25
+ constructor
26
+ · intro h
27
+ obtain ⟨i,hi,rfl⟩ := List.mem_map.mp h
28
+ have hi' := List.mem_range.mp hi
29
+ omega
30
+ · rintro ⟨hl,hu⟩
31
+ refine List.mem_map.mpr ⟨(j+(R:ℤ)).toNat,List.mem_range.mpr ?_,?_⟩ <;> omega
32
+
33
+ theorem integers_nodup (R : ℕ) : (integers R).Nodup :=
34
+ (List.nodup_range).map (by
35
+ intro a b h
36
+ have he : (a:ℤ)-(R:ℤ) = (b:ℤ)-(R:ℤ) := h
37
+ omega)
38
+
39
+ theorem signs_mem (s : Signs) : s ∈ signs := by
40
+ rcases s with ⟨a,b,c⟩
41
+ cases a <;> cases b <;> cases c <;> simp [signs]
42
+
43
+ theorem labels_nodup (r : Radii) : (labels r).Nodup := by
44
+ apply List.Nodup.product
45
+ · exact (integers_nodup r.1).product ((integers_nodup r.2.1).product (integers_nodup r.2.2))
46
+ · decide
47
+
48
+ theorem labels_length (r : Radii) :
49
+ (labels r).length = 8*((2*r.1+1)*(2*r.2.1+1)*(2*r.2.2+1)) := by
50
+ simp only [labels,cells,signs,integers,List.length_product,List.length_map,List.length_range]
51
+ simp only [List.length_cons,List.length_nil]
52
+ ring
53
+
54
+ theorem mem_labels (r : Radii) (l : Registers×Signs) :
55
+ l ∈ labels r ↔ (RationalGaussNodes.index l.1 l.2).1 ∈ centeredGridIndices (radiiVector r) := by
56
+ rcases l with ⟨⟨a,b,c⟩,s⟩
57
+ rw [labels,List.mem_product]
58
+ simp only [signs_mem,and_true,cells,List.mem_product,mem_integers]
59
+ rw [mem_centeredGridIndices]
60
+ constructor
61
+ · rintro ⟨h0,h1,h2⟩ i
62
+ fin_cases i
63
+ · simpa [RationalGaussNodes.index,radiiVector] using h0
64
+ · simpa [RationalGaussNodes.index,radiiVector] using h1
65
+ · simpa [RationalGaussNodes.index,radiiVector] using h2
66
+ · intro h
67
+ exact ⟨by simpa [RationalGaussNodes.index,radiiVector] using h 0,
68
+ by simpa [RationalGaussNodes.index,radiiVector] using h 1,
69
+ by simpa [RationalGaussNodes.index,radiiVector] using h 2⟩
70
+
71
+ end ContinuumCoulomb.CenteredGaussLabels
72
+
73
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredGrid.lean ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.CubeIntegral
2
+
3
+ namespace OAI
4
+
5
+ /-! A concrete finite family of lattice cubes tiles the enclosing rectangular
6
+ slab, including its boundary. -/
7
+
8
+ noncomputable section
9
+ open MeasureTheory
10
+ open scoped BigOperators Classical
11
+ namespace ContinuumCoulomb
12
+
13
+ def centeredGridIndices (r : Fin 3 → ℕ) : Finset (Fin 3 → ℤ) :=
14
+ Fintype.piFinset (fun i => Finset.Icc (-(r i : ℤ)) (r i : ℤ))
15
+
16
+ theorem mem_centeredGridIndices (r : Fin 3 → ℕ) (k : Fin 3 → ℤ) :
17
+ k ∈ centeredGridIndices r ↔ ∀ i, -(r i : ℤ) ≤ k i ∧ k i ≤ (r i : ℤ) := by
18
+ simp only [centeredGridIndices,Fintype.mem_piFinset,Finset.mem_Icc]
19
+
20
+ theorem exists_centered_grid_integer (N : ℕ) {h x : ℝ} (hh : 0 < h)
21
+ (hx : |x| ≤ ((N:ℝ)+1/2)*h) :
22
+ ∃ k : ℤ, -(N:ℤ) ≤ k ∧ k ≤ (N:ℤ) ∧ |x-h*(k:ℝ)| ≤ h/2 := by
23
+ let j : ℤ := ⌊x/h+1/2⌋
24
+ have hx' := abs_le.mp hx
25
+ have he : (x/h)*h = x := div_mul_cancel₀ _ hh.ne'
26
+ have hjl : (j:ℝ) ≤ x/h+1/2 := Int.floor_le _
27
+ have hju : x/h+1/2 < (j:ℝ)+1 := Int.lt_floor_add_one _
28
+ have hjlow : -(N:ℤ) ≤ j := by
29
+ apply Int.le_floor.mpr
30
+ push_cast
31
+ nlinarith
32
+ by_cases hj : j ≤ (N:ℤ)
33
+ · refine ⟨j,hjlow,hj,abs_le.mpr ⟨?_,?_⟩⟩
34
+ · nlinarith [mul_le_mul_of_nonneg_right hjl hh.le]
35
+ · nlinarith [mul_lt_mul_of_pos_right hju hh]
36
+ · refine ⟨(N:ℤ),by omega,le_rfl,abs_le.mpr ⟨?_,?_⟩⟩
37
+ · have hjn : (N:ℝ)+1 ≤ (j:ℝ) := by exact_mod_cast (show (N:ℤ)+1 ≤ j by omega)
38
+ norm_num only [Int.cast_natCast]
39
+ nlinarith [mul_le_mul_of_nonneg_right hjn hh.le,mul_le_mul_of_nonneg_right hjl hh.le]
40
+ · exact_mod_cast (show x-h*(N:ℝ) ≤ h/2 by nlinarith [hx'.2])
41
+
42
+ theorem centeredGrid_covers (r : Fin 3 → ℕ) {h : ℝ} (hh : 0 < h) :
43
+ (⋃ k : {k // k ∈ centeredGridIndices r}, positionCube (gaussCellCenter h k.val) h) =
44
+ {x : Position | ∀ i, |x i| ≤ ((r i:ℝ)+1/2)*h} := by
45
+ ext x
46
+ constructor
47
+ · intro hx
48
+ obtain ⟨k,hk⟩ := Set.mem_iUnion.mp hx
49
+ have hki := (mem_centeredGridIndices r k.val).mp k.property
50
+ intro i
51
+ have hc := abs_le.mp (mem_positionCube.mp hk i)
52
+ have hb1 : -(r i:ℝ) ≤ (k.val i:ℝ) := by exact_mod_cast (hki i).1
53
+ have hb2 : (k.val i:ℝ) ≤ (r i:ℝ) := by exact_mod_cast (hki i).2
54
+ apply abs_le.mpr
55
+ change -(h/2) ≤ x i-h*(k.val i:ℝ) ∧ x i-h*(k.val i:ℝ) ≤ h/2 at hc
56
+ rcases hc with ⟨hcl,hcu⟩
57
+ constructor <;> nlinarith [mul_le_mul_of_nonneg_left hb1 hh.le,
58
+ mul_le_mul_of_nonneg_left hb2 hh.le]
59
+ · intro hx
60
+ choose k hk1 hk2 hk3 using fun i => exists_centered_grid_integer (r i) hh (hx i)
61
+ refine Set.mem_iUnion.mpr ⟨⟨k,(mem_centeredGridIndices r k).mpr (fun i => ⟨hk1 i,hk2 i⟩)⟩,?_⟩
62
+ rw [mem_positionCube]
63
+ exact hk3
64
+
65
+ theorem grid_cell_integral_sum_eq {ι : Type*} [Fintype ι]
66
+ (index : ι → Fin 3 → ℤ) (hindex : Function.Injective index)
67
+ {h : ℝ} (hh : 0 < h) {B : Set Position}
68
+ (hcover : (⋃ i, positionCube (gaussCellCenter h (index i)) h) = B)
69
+ (f : Position → ℝ) (hf : IntegrableOn f B) :
70
+ (∑ i, ∫ x in positionCube (gaussCellCenter h (index i)) h, f x) = ∫ x in B, f x := by
71
+ have he (i : ι) := positionOpenCube_ae_eq (gaussCellCenter h (index i)) h
72
+ have hsets : (⋃ i, positionOpenCube (gaussCellCenter h (index i)) h) =ᵐ[volume]
73
+ (⋃ i, positionCube (gaussCellCenter h (index i)) h) := by
74
+ filter_upwards [ae_all_iff.mpr he] with x hx
75
+ simp only [Set.mem_iUnion]
76
+ simp_rw [hx]
77
+ have hi (i : ι) : IntegrableOn f (positionOpenCube (gaussCellCenter h (index i)) h) := by
78
+ apply hf.mono_set
79
+ intro x hx
80
+ rw [← hcover]
81
+ exact Set.mem_iUnion.mpr ⟨i,positionOpenCube_subset _ _ hx⟩
82
+ calc
83
+ _ = ∑ i, ∫ x in positionOpenCube (gaussCellCenter h (index i)) h, f x := by
84
+ apply Finset.sum_congr rfl
85
+ intro i _
86
+ exact (setIntegral_congr_set (he i)).symm
87
+ _ = ∫ x in ⋃ i, positionOpenCube (gaussCellCenter h (index i)) h, f x :=
88
+ (integral_iUnion_fintype (fun i => positionOpenCube_measurable _ _)
89
+ (fun i j hij => grid_openCubes_disjoint hh (fun he => hij (hindex he))) hi).symm
90
+ _ = ∫ x in ⋃ i, positionCube (gaussCellCenter h (index i)) h, f x :=
91
+ setIntegral_congr_set hsets
92
+ _ = _ := by rw [hcover]
93
+
94
+ end ContinuumCoulomb
95
+
96
+ end
97
+
98
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/CenteredPhysicalThreshold.lean ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.SlabBoxProgram
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Reduction.PhysicalThreshold
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Programs.GaussianFrequencyProgram
4
+
5
+ namespace OAI
6
+
7
+ /-! Physical threshold reference for the exact half-cell boundary of the
8
+ centered grid. The finite threshold is scaled by lambda and the true rational
9
+ slab reference by lambda squared times the electron count. -/
10
+
11
+ noncomputable section
12
+ namespace ContinuumCoulomb.CenteredPhysicalThreshold
13
+
14
+ abbrev Geometry := ℕ × (ℕ × ℕ)
15
+ abbrev Input := Geometry × (ℕ × (ℕ × (ℚ × ℚ)))
16
+
17
+ def amplification (rho mesh : ℕ) : ℚ := 8*(mesh:ℚ)^3/rho
18
+
19
+ def precision (x : Input) : ℕ :=
20
+ 8*(8*x.1.1^3+1)^2*(x.2.1+1)*(x.2.2.1+1)
21
+
22
+ def reference (rho : ℕ) (x : Input) : ℚ :=
23
+ SlabBoxSchedule.value rho (SlabBoxSchedule.centered (precision x) x.1.1 x.1.2.1 x.1.2.2)+
24
+ (GaussianFrequency.approximate rho (precision x)-1)/2
25
+
26
+ def offset (rho : ℕ) (x : Input) : ℚ :=
27
+ amplification rho x.1.1^2*x.2.1*reference rho x
28
+
29
+ def value (rho : ℕ) (x : Input) : ℚ×ℚ :=
30
+ (offset rho x+amplification rho x.1.1*x.2.2.2.1,
31
+ offset rho x+amplification rho x.1.1*x.2.2.2.2)
32
+
33
+ def actualReference (rho : ℕ) (g : Geometry) : ℝ :=
34
+ slabPotential (rho:ℝ) (SlabBoxSchedule.centeredWidth g.2.1 g.1:ℝ)
35
+ (SlabBoxSchedule.centeredWidth g.2.2 g.1:ℝ) 0+(GaussianFrequency.frequency rho-1)/2
36
+
37
+ def actualOffset (rho : ℕ) (x : Input) : ℝ :=
38
+ (amplification rho x.1.1:ℝ)^2*(x.2.1:ℝ)*actualReference rho x.1
39
+
40
+ theorem reference_error (rho : ℕ) (x : Input) (hmesh : 0 < x.1.1) :
41
+ |(reference rho x:ℝ)-actualReference rho x.1| ≤
42
+ 2/(precision x+1:ℝ) := by
43
+ have hs := SlabBoxSchedule.centered_error rho (precision x) x.1.1 x.1.2.1 x.1.2.2 hmesh
44
+ rw [← SlabBoxSchedule.centeredWidth_real,← SlabBoxSchedule.centeredWidth_real] at hs
45
+ have hf := GaussianFrequency.approximation_error rho (precision x)
46
+ have he : (reference rho x:ℝ)-actualReference rho x.1 =
47
+ ((SlabBoxSchedule.value rho (SlabBoxSchedule.centered (precision x) x.1.1 x.1.2.1 x.1.2.2):ℝ)-
48
+ slabPotential (rho:ℝ) (SlabBoxSchedule.centeredWidth x.1.2.1 x.1.1:ℝ)
49
+ (SlabBoxSchedule.centeredWidth x.1.2.2 x.1.1:ℝ) 0)+
50
+ ((GaussianFrequency.approximate rho (precision x):ℝ)-GaussianFrequency.frequency rho)/2 := by
51
+ simp only [reference,actualReference,Rat.cast_add,Rat.cast_sub,Rat.cast_div,Rat.cast_one,
52
+ Rat.cast_ofNat]
53
+ ring
54
+ rw [he]
55
+ apply (abs_add_le _ _).trans
56
+ rw [abs_div,abs_of_pos (by norm_num : (0:ℝ) < 2)]
57
+ have hn : 0 ≤ ((precision x:ℝ)+1)⁻¹ := by positivity
58
+ simp only [div_eq_mul_inv] at hs ⊢
59
+ nlinarith
60
+
61
+ theorem amplification_bound (rho mesh : ℕ) (hrho : 0 < rho) :
62
+ 0 ≤ (amplification rho mesh:ℝ) ∧ (amplification rho mesh:ℝ) ≤ 8*(mesh:ℝ)^3 := by
63
+ have hp : 0 < (rho:ℝ) := by exact_mod_cast hrho
64
+ have h1 : 1 ≤ (rho:ℝ) := by exact_mod_cast (Nat.succ_le_iff.mpr hrho)
65
+ simp only [amplification,Rat.cast_div,Rat.cast_mul,Rat.cast_ofNat,Rat.cast_pow,Rat.cast_natCast]
66
+ constructor
67
+ · positivity
68
+ · exact div_le_self (by positivity) h1
69
+
70
+ theorem offset_error (rho : ℕ) (hrho : 0 < rho) (x : Input) (hmesh : 0 < x.1.1) :
71
+ |(offset rho x:ℝ)-actualOffset rho x| ≤ 1/(x.2.2.1+1:ℝ) := by
72
+ have he := reference_error rho x hmesh
73
+ have ha := amplification_bound rho x.1.1 hrho
74
+ have hsq : (amplification rho x.1.1:ℝ)^2 ≤ (8*(x.1.1:ℝ)^3+1)^2 := by
75
+ nlinarith
76
+ have hcoef : (amplification rho x.1.1:ℝ)^2*(x.2.1:ℝ)*2 ≤
77
+ 8*(8*(x.1.1:ℝ)^3+1)^2*((x.2.1:ℝ)+1) := by
78
+ have ht := mul_le_mul_of_nonneg_right hsq (Nat.cast_nonneg x.2.1)
79
+ nlinarith [sq_nonneg (8*(x.1.1:ℝ)^3+1)]
80
+ have hprec : (precision x:ℝ) =
81
+ 8*(8*(x.1.1:ℝ)^3+1)^2*((x.2.1:ℝ)+1)*((x.2.2.1:ℝ)+1) := by
82
+ simp [precision]
83
+ have hden : 0 < (precision x:ℝ)+1 := by positivity
84
+ have hp : 0 < (x.2.2.1:ℝ)+1 := by positivity
85
+ have hprod : (amplification rho x.1.1:ℝ)^2*(x.2.1:ℝ)*2*((x.2.2.1:ℝ)+1) ≤
86
+ (precision x:ℝ)+1 := by
87
+ rw [hprec]
88
+ nlinarith [mul_le_mul_of_nonneg_right hcoef hp.le]
89
+ have hid : (offset rho x:ℝ)-actualOffset rho x =
90
+ (amplification rho x.1.1:ℝ)^2*(x.2.1:ℝ)*
91
+ ((reference rho x:ℝ)-actualReference rho x.1) := by
92
+ simp only [offset,actualOffset,Rat.cast_mul,Rat.cast_pow,Rat.cast_natCast]
93
+ ring
94
+ rw [hid,abs_mul,abs_of_nonneg (by positivity : 0 ≤ (amplification rho x.1.1:ℝ)^2*(x.2.1:ℝ))]
95
+ apply (mul_le_mul_of_nonneg_left he (by positivity)).trans
96
+ apply (le_div_iff₀ hp).mpr
97
+ calc
98
+ _ = ((amplification rho x.1.1:ℝ)^2*(x.2.1:ℝ)*2*
99
+ ((x.2.2.1:ℝ)+1))/((precision x:ℝ)+1) := by ring
100
+ _ ≤ 1 := (div_le_one hden).mpr hprod
101
+
102
+ theorem lower_error (rho : ℕ) (hrho : 0 < rho) (x : Input) (hmesh : 0 < x.1.1) :
103
+ |((value rho x).1:ℝ)-(actualOffset rho x+
104
+ (amplification rho x.1.1:ℝ)*(x.2.2.2.1:ℝ))| ≤ 1/(x.2.2.1+1:ℝ) := by
105
+ simpa only [value,Rat.cast_add,Rat.cast_mul,add_sub_add_right_eq_sub] using offset_error rho hrho x hmesh
106
+
107
+ theorem upper_error (rho : ℕ) (hrho : 0 < rho) (x : Input) (hmesh : 0 < x.1.1) :
108
+ |((value rho x).2:ℝ)-(actualOffset rho x+
109
+ (amplification rho x.1.1:ℝ)*(x.2.2.2.2:ℝ))| ≤ 1/(x.2.2.1+1:ℝ) := by
110
+ simpa only [value,Rat.cast_add,Rat.cast_mul,add_sub_add_right_eq_sub] using offset_error rho hrho x hmesh
111
+
112
+ theorem gap (rho : ℕ) (x : Input) :
113
+ (value rho x).2-(value rho x).1 = amplification rho x.1.1*(x.2.2.2.2-x.2.2.2.1) := by
114
+ unfold value
115
+ ring
116
+
117
+ end ContinuumCoulomb.CenteredPhysicalThreshold
118
+
119
+ end
120
+
121
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/ClassicalH1.lean ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.Reduction.Model
2
+ import Mathlib.Analysis.Calculus.LineDeriv.IntegrationByParts
3
+
4
+ namespace OAI
5
+
6
+ /-! C1 functions with square-integrable classical partials belong to the
7
+ actual weak H1 domain. Only the test function needs compact support; this
8
+ allows the decaying manufactured orbitals and their finite Slater sums. -/
9
+
10
+ noncomputable section
11
+ open MeasureTheory
12
+ namespace ContinuumCoulomb
13
+
14
+ theorem complex_C1_test_ibp {n : ℕ} (f : Configuration n → ℂ) (hf : ContDiff ℝ 1 f)
15
+ (φ : Configuration n → ℝ) (hφ : ContDiff ℝ 1 φ) (hc : HasCompactSupport φ) (v : Configuration n) :
16
+ (∫ x, f x * (fderiv ℝ φ x v : ℂ)) = -(∫ x, fderiv ℝ f x v * (φ x : ℂ)) := by
17
+ let g : Configuration n → ℂ := fun x => (φ x : ℂ)
18
+ have hg : ContDiff ℝ 1 g := Complex.ofRealCLM.contDiff.comp hφ
19
+ have hgc : HasCompactSupport g := hc.comp_left Complex.ofReal_zero
20
+ have hd (x : Configuration n) : fderiv ℝ g x v = (fderiv ℝ φ x v : ℂ) :=
21
+ congrArg (fun L : Configuration n →L[ℝ] ℂ => L v)
22
+ ((Complex.ofRealCLM.hasFDerivAt.comp x (hφ.differentiable (by norm_num) x).hasFDerivAt).fderiv)
23
+ have hf' : Continuous (fun x => fderiv ℝ f x v) :=
24
+ (hf.continuous_fderiv (by norm_num)).clm_apply continuous_const
25
+ have hg' : Continuous (fun x => fderiv ℝ g x v) :=
26
+ (hg.continuous_fderiv (by norm_num)).clm_apply continuous_const
27
+ have hi1 : Integrable (fun x => fderiv ℝ f x v * g x) :=
28
+ (hf'.mul hg.continuous).integrable_of_hasCompactSupport hgc.mul_left
29
+ have hi2 : Integrable (fun x => f x * fderiv ℝ g x v) :=
30
+ (hf.continuous.mul hg').integrable_of_hasCompactSupport (hgc.fderiv_apply ℝ v).mul_left
31
+ have hi3 : Integrable (fun x => f x * g x) :=
32
+ (hf.continuous.mul hg.continuous).integrable_of_hasCompactSupport hgc.mul_left
33
+ have h := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable hi1 hi2 hi3
34
+ (fun x _ => hf.differentiable (by norm_num) x) (fun x _ => hg.differentiable (by norm_num) x)
35
+ simpa only [hd] using h
36
+
37
+ def classicalH1State {n : ℕ} (f : SpinConfiguration n → Configuration n → ℂ)
38
+ (hf : ∀ s, ContDiff ℝ 1 (f s)) (hL2 : ∀ s, MemLp (f s) 2)
39
+ (hpartial : ∀ s a, MemLp (fun x => fderiv ℝ (f s) x (EuclideanSpace.single a 1)) 2) :
40
+ Coulomb.H1Vector n where
41
+ value := f
42
+ gradient s a x := fderiv ℝ (f s) x (EuclideanSpace.single a 1)
43
+ value_L2 := hL2
44
+ partial_L2 := hpartial
45
+ weak_partial s a φ hφ hc := complex_C1_test_ibp (f s) (hf s) φ (hφ.of_le (by simp)) hc _
46
+
47
+ end ContinuumCoulomb
48
+
49
+ end
50
+
51
+ end OAI
lean/OAI/MathematicalPhysics/ContinuumCoulomb/OneParticle/ClassicalResidualPairing.lean ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.WeakComplexLaplacian
2
+ import OAI.MathematicalPhysics.ContinuumCoulomb.OneParticle.BoundedFormCross
3
+ import OAI.MathematicalPhysics.ContinuumCoulomb.ManyBody.TensorTotalReplacement
4
+
5
+ namespace OAI
6
+
7
+ /-! An actual differential residual controls the mixed bounded-potential
8
+ form against every weak-H1 state, without restricting its smoothness. -/
9
+
10
+ noncomputable section
11
+ open MeasureTheory
12
+ open scoped BigOperators Classical
13
+ namespace ContinuumCoulomb
14
+
15
+ theorem h1Coordinates_complex_inner {n : ℕ} (u v : Coulomb.H1Vector n) (a : H1Index n) :
16
+ inner ℂ (h1Coordinates u a) (h1Coordinates v a) =
17
+ ∫ x, star (h1CoordinateFunction u a x)*h1CoordinateFunction v a x :=
18
+ h1_inner_complex_coordinate v a _ (h1Coordinate_memLp u a)
19
+
20
+ theorem h1Coordinates_complex_mass_inner {n : ℕ} (u v : Coulomb.H1Vector n) :
21
+ (∑ s, inner ℂ (h1Coordinates u (Sum.inl s)) (h1Coordinates v (Sum.inl s))) =
22
+ inner ℂ u.toHilbert v.toHilbert := by
23
+ rw [PiLp.inner_apply]
24
+ rfl
25
+
26
+ theorem boundedPotential_complex_pairing {n : ℕ} (u v : Coulomb.H1Vector n)
27
+ (V : Configuration n → ℝ) (hV : Continuous V) (B : ℝ) (hB : ∀ x, |V x| ≤ B)
28
+ (s : SpinConfiguration n) :
29
+ inner ℂ (h1Coordinates u (Sum.inl s))
30
+ (BoundedPotential.operator V hV B hB (h1Coordinates v (Sum.inl s))) =
31
+ ∫ x, star (u.value s x)*((V x:ℂ)*v.value s x) := by
32
+ rw [L2.inner_def]
33
+ apply integral_congr_ae
34
+ filter_upwards [(h1Coordinate_memLp u (Sum.inl s)).coeFn_toLp,
35
+ (h1Coordinate_memLp v (Sum.inl s)).coeFn_toLp,
36
+ BoundedPotential.operator_ae V hV B hB (h1Coordinates v (Sum.inl s))] with x hu hv hA
37
+ change h1Coordinates u (Sum.inl s) x = u.value s x at hu
38
+ change h1Coordinates v (Sum.inl s) x = v.value s x at hv
39
+ rw [hA,hu,hv,RCLike.inner_apply]
40
+ exact mul_comm _ _
41
+
42
+ theorem classical_residual_pairing (hdensity : PublishedSobolevSmoothDensity)
43
+ {n : ℕ} (u v : Coulomb.H1Vector n)
44
+ (V : Configuration n → ℝ) (hV : Continuous V) (B E : ℝ) (hB : ∀ x, |V x| ≤ B)
45
+ (R : SpinConfiguration n → Configuration n → ℂ)
46
+ (hR : ∀ s, MemLp (R s) 2)
47
+ (hu : ∀ s, ContDiff ℝ 2 (u.value s))
48
+ (hdu : ∀ s a x, u.gradient s a x = configurationComplexPartial (u.value s) a x)
49
+ (heq : ∀ s x, R s x = (-1/2:ℂ)*configurationComplexLaplacian (u.value s) x+
50
+ (V x:ℂ)*u.value s x-(E:ℂ)*u.value s x) :
51
+ graphComplexCross (BoundedPotential.operator V hV B hB) (h1Coordinates u) (h1Coordinates v)-
52
+ (E:ℂ)*inner ℂ u.toHilbert v.toHilbert =
53
+ ∑ s, ∫ x, star (R s x)*v.value s x := by
54
+ have hm (s : SpinConfiguration n) : MemLp (fun x => (V x:ℂ)*u.value s x) 2 := by
55
+ apply (u.value_L2 s).of_le_mul (c := B)
56
+ ((Complex.continuous_ofReal.comp hV).aestronglyMeasurable.mul (u.value_L2 s).aestronglyMeasurable)
57
+ filter_upwards [] with x
58
+ change ‖(V x:ℂ)*u.value s x‖ ≤ B*‖u.value s x‖
59
+ simp only [norm_mul,Complex.norm_real,Real.norm_eq_abs]
60
+ exact mul_le_mul_of_nonneg_right (hB x) (norm_nonneg _)
61
+ have hLap (s : SpinConfiguration n) : MemLp (configurationComplexLaplacian (u.value s)) 2 := by
62
+ have hfun : configurationComplexLaplacian (u.value s) =
63
+ (fun x => (2:ℂ)*((V x:ℂ)*u.value s x-(E:ℂ)*u.value s x-R s x)) := by
64
+ funext x
65
+ linear_combination 2*(heq s x)
66
+ rw [hfun]
67
+ exact ((hm s).sub ((u.value_L2 s).const_mul (E:ℂ)) |>.sub (hR s)).const_mul 2
68
+ have hp (s : SpinConfiguration n) (a : Fin n × Fin 3) :
69
+ MemLp (configurationComplexPartial (u.value s) a) 2 :=
70
+ (memLp_congr_ae (Filter.Eventually.of_forall (hdu s a))).mp (u.partial_L2 s a)
71
+ have hkin (s : SpinConfiguration n) := weakH1_complex_laplacian_pairing hdensity
72
+ (u.value s) (hu s) (hp s) (hLap s) v s
73
+ have hpoint (s : SpinConfiguration n) :
74
+ (1/2:ℂ)*(∑ a, ∫ x, star (u.gradient s a x)*v.gradient s a x)+
75
+ (∫ x, star (u.value s x)*((V x:ℂ)*v.value s x))-
76
+ (E:ℂ)*(∫ x, star (u.value s x)*v.value s x) =
77
+ ∫ x, star (R s x)*v.value s x := by
78
+ have hLI := (hLap s).star.integrable_mul (v.value_L2 s)
79
+ have hVI := (hm s).star.integrable_mul (v.value_L2 s)
80
+ have hUI := (u.value_L2 s).star.integrable_mul (v.value_L2 s)
81
+ have hhalf : star (-1/2:ℂ) = (-1/2:ℂ) := by
82
+ change (starRingEnd ℂ) (-1/2) = (-1/2:ℂ)
83
+ simp only [map_div₀,map_neg,map_one,map_ofNat]
84
+ have hE : star (E:ℂ) = (E:ℂ) := Complex.conj_ofReal E
85
+ have hprod (x : Configuration n) : star (R s x)*v.value s x =
86
+ (-1/2:ℂ)*(star (configurationComplexLaplacian (u.value s) x)*v.value s x)+
87
+ star ((V x:ℂ)*u.value s x)*v.value s x-
88
+ (E:ℂ)*(star (u.value s x)*v.value s x) := by
89
+ rw [heq]
90
+ simp only [star_sub,star_add,star_mul,hhalf,hE]
91
+ ring
92
+ simp_rw [hprod]
93
+ have hsub := integral_sub ((hLI.const_mul (-1/2:ℂ)).add hVI) (hUI.const_mul (E:ℂ))
94
+ have hadd := integral_add (hLI.const_mul (-1/2:ℂ)) hVI
95
+ simp only [Pi.add_apply,Pi.mul_apply,Pi.star_apply] at hsub hadd
96
+ rw [hsub,hadd,integral_const_mul,integral_const_mul]
97
+ simp_rw [← hdu] at hkin
98
+ rw [hkin]
99
+ have hvprod : (∫ x, star ((V x:ℂ)*u.value s x)*v.value s x) =
100
+ ∫ x, star (u.value s x)*((V x:ℂ)*v.value s x) := by
101
+ congr 1
102
+ funext x
103
+ simp only [star_mul,Complex.star_def,Complex.conj_ofReal]
104
+ ring
105
+ rw [hvprod]
106
+ ring
107
+ rw [← h1Coordinates_complex_mass_inner]
108
+ simp only [graphComplexCross,h1Coordinates_complex_inner,boundedPotential_complex_pairing,
109
+ h1CoordinateFunction]
110
+ simp only [Finset.mul_sum,← Finset.sum_add_distrib,← Finset.sum_sub_distrib]
111
+ exact Finset.sum_congr rfl (fun s _ => by simpa only [Finset.mul_sum] using hpoint s)
112
+
113
+ theorem residual_integral_square_bound {n : ℕ} (v : Coulomb.H1Vector n)
114
+ (R : SpinConfiguration n → Configuration n → ℂ) (hR : ∀ s, MemLp (R s) 2) :
115
+ ‖∑ s, ∫ x, star (R s x)*v.value s x‖^2 ≤
116
+ (∑ s, ∫ x, ‖R s x‖^2)*Coulomb.mass v := by
117
+ let r (s : SpinConfiguration n) : Lp ℂ 2 (volume : Measure (Configuration n)) :=
118
+ (hR s).toLp (R s)
119
+ have he (s : SpinConfiguration n) : (∫ x, star (R s x)*v.value s x) =
120
+ inner ℂ (r s) (h1Coordinates v (Sum.inl s)) :=
121
+ (h1_inner_complex_coordinate v (Sum.inl s) _ (hR s)).symm
122
+ simp only [he]
123
+ have ht : ‖∑ s, inner ℂ (r s) (h1Coordinates v (Sum.inl s))‖ ≤
124
+ ∑ s, ‖r s‖*‖h1Coordinates v (Sum.inl s)‖ :=
125
+ (norm_sum_le _ _).trans (Finset.sum_le_sum (fun s _ => norm_inner_le_norm _ _))
126
+ have hb := (pow_le_pow_left₀ (norm_nonneg _) ht 2).trans
127
+ (Finset.sum_mul_sq_le_sq_mul_sq Finset.univ _ _)
128
+ simpa only [r,Coulomb.norm_toLp_sq_complex,h1Coordinates_norm_sq,h1CoordinateFunction,
129
+ Coulomb.mass] using hb
130
+
131
+ end ContinuumCoulomb
132
+
133
+ end
134
+
135
+ end OAI